Commit 820512b30d86b6b90fc95e52028012592dc2bb90

Authored by Perry Werneck
1 parent ea427bd6

Ajustes para tratamento de charset em windows.

@@ -5,7 +5,7 @@ msgid "" @@ -5,7 +5,7 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2016-10-24 17:01-0200\n" 8 +"POT-Creation-Date: 2016-10-24 17:44-0200\n"
9 "PO-Revision-Date: 2016-05-31 11:16-0300\n" 9 "PO-Revision-Date: 2016-05-31 11:16-0300\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Português <perry.werneck@gmail.com>\n" 11 "Language-Team: Português <perry.werneck@gmail.com>\n"
src/classlib/session.cc
@@ -219,6 +219,8 @@ @@ -219,6 +219,8 @@
219 // Object settings 219 // Object settings
220 void session::set_display_charset(const char *remote, const char *local) 220 void session::set_display_charset(const char *remote, const char *local)
221 { 221 {
  222 + trace("%s(%s,%s)",__FUNCTION__,remote,local);
  223 +
222 #ifdef HAVE_ICONV 224 #ifdef HAVE_ICONV
223 string display_charset = this->get_display_charset(); 225 string display_charset = this->get_display_charset();
224 226
@@ -231,6 +233,8 @@ @@ -231,6 +233,8 @@
231 if(!remote) 233 if(!remote)
232 remote = display_charset.c_str(); 234 remote = display_charset.c_str();
233 235
  236 + trace("%s remote=%s local=%s",__FUNCTION__,remote,local);
  237 +
234 if(strcmp(local,remote)) 238 if(strcmp(local,remote))
235 { 239 {
236 // Local and remote charsets aren't the same, setup conversion 240 // Local and remote charsets aren't the same, setup conversion
src/plugins/rx3270/rexx_methods.cc
@@ -621,6 +621,12 @@ RexxMethod1(RexxStringObject, rx3270_method_get_display_charset, CSELF, sessionP @@ -621,6 +621,12 @@ RexxMethod1(RexxStringObject, rx3270_method_get_display_charset, CSELF, sessionP
621 return context->String(ret.c_str()); 621 return context->String(ret.c_str());
622 } 622 }
623 623
  624 +RexxMethod2(int, rx3270_method_set_display_charset, CSELF, sessionPtr, CSTRING, text)
  625 +{
  626 + ((session *) sessionPtr)->set_display_charset(NULL,text);
  627 + return 0;
  628 +}
  629 +
624 RexxMethod2(int, rx3270_method_set_unlock_delay, CSELF, sessionPtr, int, delay) 630 RexxMethod2(int, rx3270_method_set_unlock_delay, CSELF, sessionPtr, int, delay)
625 { 631 {
626 session *hSession = (session *) sessionPtr; 632 session *hSession = (session *) sessionPtr;
src/plugins/rx3270/rx3270.cls
@@ -95,8 +95,11 @@ @@ -95,8 +95,11 @@
95 ::METHOD GETFILENAME EXTERNAL "LIBRARY rx3270 rx3270_method_get_filename" 95 ::METHOD GETFILENAME EXTERNAL "LIBRARY rx3270 rx3270_method_get_filename"
96 96
97 ::METHOD GETDISPLAYCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_get_display_charset" 97 ::METHOD GETDISPLAYCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_get_display_charset"
  98 +::METHOD SETDISPLAYCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_set_display_charset"
  99 +
98 ::METHOD GETHOSTCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_get_host_charset" 100 ::METHOD GETHOSTCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_get_host_charset"
99 ::METHOD SETHOSTCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_set_host_charset" 101 ::METHOD SETHOSTCHARSET EXTERNAL "LIBRARY rx3270 rx3270_method_set_host_charset"
  102 +
100 ::METHOD SETUNLOCKDELAY EXTERNAL "LIBRARY rx3270 rx3270_method_set_unlock_delay" 103 ::METHOD SETUNLOCKDELAY EXTERNAL "LIBRARY rx3270 rx3270_method_set_unlock_delay"
101 104
102 ::method waitForStringAt 105 ::method waitForStringAt
src/plugins/rx3270/rx3270.h
@@ -136,6 +136,7 @@ @@ -136,6 +136,7 @@
136 REXX_METHOD_PROTOTYPE(rx3270_method_set_cursor_addr); 136 REXX_METHOD_PROTOTYPE(rx3270_method_set_cursor_addr);
137 REXX_METHOD_PROTOTYPE(rx3270_method_input_text); 137 REXX_METHOD_PROTOTYPE(rx3270_method_input_text);
138 REXX_METHOD_PROTOTYPE(rx3270_method_get_display_charset); 138 REXX_METHOD_PROTOTYPE(rx3270_method_get_display_charset);
  139 + REXX_METHOD_PROTOTYPE(rx3270_method_set_display_charset);
139 REXX_METHOD_PROTOTYPE(rx3270_method_get_host_charset); 140 REXX_METHOD_PROTOTYPE(rx3270_method_get_host_charset);
140 REXX_METHOD_PROTOTYPE(rx3270_method_set_host_charset); 141 REXX_METHOD_PROTOTYPE(rx3270_method_set_host_charset);
141 REXX_METHOD_PROTOTYPE(rx3270_method_set_unlock_delay); 142 REXX_METHOD_PROTOTYPE(rx3270_method_set_unlock_delay);
src/plugins/rx3270/rxapimain.cc
@@ -145,6 +145,8 @@ RexxMethodEntry rx3270_methods[] = @@ -145,6 +145,8 @@ RexxMethodEntry rx3270_methods[] =
145 REXX_METHOD(rx3270_method_input_text, rx3270_method_input_text ), 145 REXX_METHOD(rx3270_method_input_text, rx3270_method_input_text ),
146 146
147 REXX_METHOD(rx3270_method_get_display_charset, rx3270_method_get_display_charset ), 147 REXX_METHOD(rx3270_method_get_display_charset, rx3270_method_get_display_charset ),
  148 + REXX_METHOD(rx3270_method_set_display_charset, rx3270_method_set_display_charset ),
  149 +
148 REXX_METHOD(rx3270_method_get_host_charset, rx3270_method_get_host_charset ), 150 REXX_METHOD(rx3270_method_get_host_charset, rx3270_method_get_host_charset ),
149 REXX_METHOD(rx3270_method_set_host_charset, rx3270_method_set_host_charset ), 151 REXX_METHOD(rx3270_method_set_host_charset, rx3270_method_set_host_charset ),
150 152