From 820512b30d86b6b90fc95e52028012592dc2bb90 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 25 Oct 2016 10:16:16 -0200 Subject: [PATCH] Ajustes para tratamento de charset em windows. --- po/pt_BR.po | 2 +- src/classlib/session.cc | 4 ++++ src/plugins/rx3270/rexx_methods.cc | 6 ++++++ src/plugins/rx3270/rx3270.cls | 3 +++ src/plugins/rx3270/rx3270.h | 1 + src/plugins/rx3270/rxapimain.cc | 2 ++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 7f4983f..cfbeeb7 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-10-24 17:01-0200\n" +"POT-Creation-Date: 2016-10-24 17:44-0200\n" "PO-Revision-Date: 2016-05-31 11:16-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português \n" diff --git a/src/classlib/session.cc b/src/classlib/session.cc index 5f4c279..ef0ee52 100644 --- a/src/classlib/session.cc +++ b/src/classlib/session.cc @@ -219,6 +219,8 @@ // Object settings void session::set_display_charset(const char *remote, const char *local) { + trace("%s(%s,%s)",__FUNCTION__,remote,local); + #ifdef HAVE_ICONV string display_charset = this->get_display_charset(); @@ -231,6 +233,8 @@ if(!remote) remote = display_charset.c_str(); + trace("%s remote=%s local=%s",__FUNCTION__,remote,local); + if(strcmp(local,remote)) { // Local and remote charsets aren't the same, setup conversion diff --git a/src/plugins/rx3270/rexx_methods.cc b/src/plugins/rx3270/rexx_methods.cc index d987fd4..c0003dc 100644 --- a/src/plugins/rx3270/rexx_methods.cc +++ b/src/plugins/rx3270/rexx_methods.cc @@ -621,6 +621,12 @@ RexxMethod1(RexxStringObject, rx3270_method_get_display_charset, CSELF, sessionP return context->String(ret.c_str()); } +RexxMethod2(int, rx3270_method_set_display_charset, CSELF, sessionPtr, CSTRING, text) +{ + ((session *) sessionPtr)->set_display_charset(NULL,text); + return 0; +} + RexxMethod2(int, rx3270_method_set_unlock_delay, CSELF, sessionPtr, int, delay) { session *hSession = (session *) sessionPtr; diff --git a/src/plugins/rx3270/rx3270.cls b/src/plugins/rx3270/rx3270.cls index 040c744..014d26f 100644 --- a/src/plugins/rx3270/rx3270.cls +++ b/src/plugins/rx3270/rx3270.cls @@ -95,8 +95,11 @@ ::METHOD GETFILENAME EXTERNAL "LIBRARY rx3270 rx3270_method_get_filename" ::METHOD GETDISPLAYCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_get_display_charset" +::METHOD SETDISPLAYCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_set_display_charset" + ::METHOD GETHOSTCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_get_host_charset" ::METHOD SETHOSTCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_set_host_charset" + ::METHOD SETUNLOCKDELAY EXTERNAL "LIBRARY rx3270 rx3270_method_set_unlock_delay" ::method waitForStringAt diff --git a/src/plugins/rx3270/rx3270.h b/src/plugins/rx3270/rx3270.h index 0972e6e..07a3fb4 100644 --- a/src/plugins/rx3270/rx3270.h +++ b/src/plugins/rx3270/rx3270.h @@ -136,6 +136,7 @@ REXX_METHOD_PROTOTYPE(rx3270_method_set_cursor_addr); REXX_METHOD_PROTOTYPE(rx3270_method_input_text); REXX_METHOD_PROTOTYPE(rx3270_method_get_display_charset); + REXX_METHOD_PROTOTYPE(rx3270_method_set_display_charset); REXX_METHOD_PROTOTYPE(rx3270_method_get_host_charset); REXX_METHOD_PROTOTYPE(rx3270_method_set_host_charset); REXX_METHOD_PROTOTYPE(rx3270_method_set_unlock_delay); diff --git a/src/plugins/rx3270/rxapimain.cc b/src/plugins/rx3270/rxapimain.cc index 1951aab..b1e7a86 100644 --- a/src/plugins/rx3270/rxapimain.cc +++ b/src/plugins/rx3270/rxapimain.cc @@ -145,6 +145,8 @@ RexxMethodEntry rx3270_methods[] = REXX_METHOD(rx3270_method_input_text, rx3270_method_input_text ), REXX_METHOD(rx3270_method_get_display_charset, rx3270_method_get_display_charset ), + REXX_METHOD(rx3270_method_set_display_charset, rx3270_method_set_display_charset ), + REXX_METHOD(rx3270_method_get_host_charset, rx3270_method_get_host_charset ), REXX_METHOD(rx3270_method_set_host_charset, rx3270_method_set_host_charset ), -- libgit2 0.21.2