diff --git a/charset.c b/charset.c index cb7111e..e33d0d0 100644 --- a/charset.c +++ b/charset.c @@ -203,6 +203,7 @@ static const unsigned short asc2uc[UT_SIZE] = typedef struct _info { const char * name; + unsigned long cgcsgid; const unsigned short const * chr; } remap; @@ -210,6 +211,7 @@ static const remap charset[] = { { "bracket", + LIB3270_DEFAULT_CGEN|LIB3270_DEFAULT_CSET, (const unsigned short const []) { 0x00ad, '[', @@ -222,6 +224,7 @@ static const remap charset[] = { "cp500", + LIB3270_DEFAULT_CGEN|0x000001F4, (const unsigned short const []) { 0x004a, '[', @@ -256,6 +259,7 @@ LIB3270_EXPORT int lib3270_set_host_charset(H3270 *hSession, const char *name) hSession->charset.host = "us"; hSession->charset.display = "ISO-8859-1"; + hSession->charset.cgcsgid = LIB3270_DEFAULT_CGEN | LIB3270_DEFAULT_CSET; // 0x02b90025 // lib3270_write_log(hSession,"charset","host.charset=%s display.charset=%s", // hSession->charset.host,hSession->charset.display); @@ -282,7 +286,8 @@ LIB3270_EXPORT int lib3270_set_host_charset(H3270 *hSession, const char *name) // Found required charset int c; - hSession->charset.host = charset[f].name; + hSession->charset.host = charset[f].name; + hSession->charset.cgcsgid = charset[f].cgcsgid; for(c=0;charset[f].chr[c];c+=2) lib3270_remap(hSession,charset[f].chr[c],charset[f].chr[c+1], BOTH, 0); diff --git a/session.c b/session.c index bc1a6e3..d0519f9 100644 --- a/session.c +++ b/session.c @@ -236,8 +236,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char hSession->saved_wraparound_mode = 1; hSession->once_cset = -1; hSession->state = LIB3270_ANSI_STATE_DATA; - hSession->cgcsgid = LIB3270_DEFAULT_CGEN | LIB3270_DEFAULT_CSET; - for(f=0;f<4;f++) hSession->csd[f] = hSession->saved_csd[f] = LIB3270_ANSI_CSD_US; diff --git a/sf.c b/sf.c index c0cac54..afe2139 100644 --- a/sf.c +++ b/sf.c @@ -945,17 +945,15 @@ static void do_qr_charsets(H3270 *hSession) *hSession->obptr++ = 0x00; /* SUBSN */ } #endif /*]*/ - SET32(hSession->obptr, hSession->cgcsgid); /* CGCSGID */ + SET32(hSession->obptr, hSession->charset.cgcsgid); /* CGCSGID */ if (!*standard_font) { /* special 3270 font, includes APL */ *hSession->obptr++ = 0x01;/* SET 1: */ if (hSession->apl_mode) - *hSession->obptr++ = 0x00;/* FLAGS: non-loadable, single-plane, - single-byte, no compare */ + *hSession->obptr++ = 0x00;/* FLAGS: non-loadable, single-plane, single-byte, no compare */ else - *hSession->obptr++ = 0x10;/* FLAGS: non-loadable, single-plane, - single-byte, no compare */ + *hSession->obptr++ = 0x10;/* FLAGS: non-loadable, single-plane, single-byte, no compare */ *hSession->obptr++ = 0xf1;/* LCID */ #if defined(X3270_DBCS) /*[*/ if (dbcs) -- libgit2 0.21.2