Commit f5e385b38c9672a56bea0d15a604927238f32d46

Authored by perry.werneck@gmail.com
1 parent a916be78

Faltou mudar o indicador de charset

Showing 3 changed files with 9 additions and 8 deletions   Show diff stats
@@ -203,6 +203,7 @@ static const unsigned short asc2uc[UT_SIZE] = @@ -203,6 +203,7 @@ static const unsigned short asc2uc[UT_SIZE] =
203 typedef struct _info 203 typedef struct _info
204 { 204 {
205 const char * name; 205 const char * name;
  206 + unsigned long cgcsgid;
206 const unsigned short const * chr; 207 const unsigned short const * chr;
207 } remap; 208 } remap;
208 209
@@ -210,6 +211,7 @@ static const remap charset[] = @@ -210,6 +211,7 @@ static const remap charset[] =
210 { 211 {
211 { 212 {
212 "bracket", 213 "bracket",
  214 + LIB3270_DEFAULT_CGEN|LIB3270_DEFAULT_CSET,
213 (const unsigned short const []) 215 (const unsigned short const [])
214 { 216 {
215 0x00ad, '[', 217 0x00ad, '[',
@@ -222,6 +224,7 @@ static const remap charset[] = @@ -222,6 +224,7 @@ static const remap charset[] =
222 224
223 { 225 {
224 "cp500", 226 "cp500",
  227 + LIB3270_DEFAULT_CGEN|0x000001F4,
225 (const unsigned short const []) 228 (const unsigned short const [])
226 { 229 {
227 0x004a, '[', 230 0x004a, '[',
@@ -256,6 +259,7 @@ LIB3270_EXPORT int lib3270_set_host_charset(H3270 *hSession, const char *name) @@ -256,6 +259,7 @@ LIB3270_EXPORT int lib3270_set_host_charset(H3270 *hSession, const char *name)
256 259
257 hSession->charset.host = "us"; 260 hSession->charset.host = "us";
258 hSession->charset.display = "ISO-8859-1"; 261 hSession->charset.display = "ISO-8859-1";
  262 + hSession->charset.cgcsgid = LIB3270_DEFAULT_CGEN | LIB3270_DEFAULT_CSET; // 0x02b90025
259 263
260 // lib3270_write_log(hSession,"charset","host.charset=%s display.charset=%s", 264 // lib3270_write_log(hSession,"charset","host.charset=%s display.charset=%s",
261 // hSession->charset.host,hSession->charset.display); 265 // hSession->charset.host,hSession->charset.display);
@@ -282,7 +286,8 @@ LIB3270_EXPORT int lib3270_set_host_charset(H3270 *hSession, const char *name) @@ -282,7 +286,8 @@ LIB3270_EXPORT int lib3270_set_host_charset(H3270 *hSession, const char *name)
282 // Found required charset 286 // Found required charset
283 int c; 287 int c;
284 288
285 - hSession->charset.host = charset[f].name; 289 + hSession->charset.host = charset[f].name;
  290 + hSession->charset.cgcsgid = charset[f].cgcsgid;
286 291
287 for(c=0;charset[f].chr[c];c+=2) 292 for(c=0;charset[f].chr[c];c+=2)
288 lib3270_remap(hSession,charset[f].chr[c],charset[f].chr[c+1], BOTH, 0); 293 lib3270_remap(hSession,charset[f].chr[c],charset[f].chr[c+1], BOTH, 0);
@@ -236,8 +236,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char @@ -236,8 +236,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char
236 hSession->saved_wraparound_mode = 1; 236 hSession->saved_wraparound_mode = 1;
237 hSession->once_cset = -1; 237 hSession->once_cset = -1;
238 hSession->state = LIB3270_ANSI_STATE_DATA; 238 hSession->state = LIB3270_ANSI_STATE_DATA;
239 - hSession->cgcsgid = LIB3270_DEFAULT_CGEN | LIB3270_DEFAULT_CSET;  
240 -  
241 239
242 for(f=0;f<4;f++) 240 for(f=0;f<4;f++)
243 hSession->csd[f] = hSession->saved_csd[f] = LIB3270_ANSI_CSD_US; 241 hSession->csd[f] = hSession->saved_csd[f] = LIB3270_ANSI_CSD_US;
@@ -945,17 +945,15 @@ static void do_qr_charsets(H3270 *hSession) @@ -945,17 +945,15 @@ static void do_qr_charsets(H3270 *hSession)
945 *hSession->obptr++ = 0x00; /* SUBSN */ 945 *hSession->obptr++ = 0x00; /* SUBSN */
946 } 946 }
947 #endif /*]*/ 947 #endif /*]*/
948 - SET32(hSession->obptr, hSession->cgcsgid); /* CGCSGID */ 948 + SET32(hSession->obptr, hSession->charset.cgcsgid); /* CGCSGID */
949 if (!*standard_font) 949 if (!*standard_font)
950 { 950 {
951 /* special 3270 font, includes APL */ 951 /* special 3270 font, includes APL */
952 *hSession->obptr++ = 0x01;/* SET 1: */ 952 *hSession->obptr++ = 0x01;/* SET 1: */
953 if (hSession->apl_mode) 953 if (hSession->apl_mode)
954 - *hSession->obptr++ = 0x00;/* FLAGS: non-loadable, single-plane,  
955 - single-byte, no compare */ 954 + *hSession->obptr++ = 0x00;/* FLAGS: non-loadable, single-plane, single-byte, no compare */
956 else 955 else
957 - *hSession->obptr++ = 0x10;/* FLAGS: non-loadable, single-plane,  
958 - single-byte, no compare */ 956 + *hSession->obptr++ = 0x10;/* FLAGS: non-loadable, single-plane, single-byte, no compare */
959 *hSession->obptr++ = 0xf1;/* LCID */ 957 *hSession->obptr++ = 0xf1;/* LCID */
960 #if defined(X3270_DBCS) /*[*/ 958 #if defined(X3270_DBCS) /*[*/
961 if (dbcs) 959 if (dbcs)