Commit b77c5b0f20c880e10544f8ccba98765c04f1b9f8
1 parent
011f253c
Exists in
master
and in
5 other branches
Faltou mudar o indicador de charset
Showing
5 changed files
with
10 additions
and
11 deletions
Show diff stats
src/include/lib3270/charset.h
src/include/lib3270/session.h
src/lib3270/charset.c
... | ... | @@ -203,6 +203,7 @@ static const unsigned short asc2uc[UT_SIZE] = |
203 | 203 | typedef struct _info |
204 | 204 | { |
205 | 205 | const char * name; |
206 | + unsigned long cgcsgid; | |
206 | 207 | const unsigned short const * chr; |
207 | 208 | } remap; |
208 | 209 | |
... | ... | @@ -210,6 +211,7 @@ static const remap charset[] = |
210 | 211 | { |
211 | 212 | { |
212 | 213 | "bracket", |
214 | + LIB3270_DEFAULT_CGEN|LIB3270_DEFAULT_CSET, | |
213 | 215 | (const unsigned short const []) |
214 | 216 | { |
215 | 217 | 0x00ad, '[', |
... | ... | @@ -222,6 +224,7 @@ static const remap charset[] = |
222 | 224 | |
223 | 225 | { |
224 | 226 | "cp500", |
227 | + LIB3270_DEFAULT_CGEN|0x000001F4, | |
225 | 228 | (const unsigned short const []) |
226 | 229 | { |
227 | 230 | 0x004a, '[', |
... | ... | @@ -256,6 +259,7 @@ LIB3270_EXPORT int lib3270_set_host_charset(H3270 *hSession, const char *name) |
256 | 259 | |
257 | 260 | hSession->charset.host = "us"; |
258 | 261 | hSession->charset.display = "ISO-8859-1"; |
262 | + hSession->charset.cgcsgid = LIB3270_DEFAULT_CGEN | LIB3270_DEFAULT_CSET; // 0x02b90025 | |
259 | 263 | |
260 | 264 | // lib3270_write_log(hSession,"charset","host.charset=%s display.charset=%s", |
261 | 265 | // hSession->charset.host,hSession->charset.display); |
... | ... | @@ -282,7 +286,8 @@ LIB3270_EXPORT int lib3270_set_host_charset(H3270 *hSession, const char *name) |
282 | 286 | // Found required charset |
283 | 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 | 292 | for(c=0;charset[f].chr[c];c+=2) |
288 | 293 | lib3270_remap(hSession,charset[f].chr[c],charset[f].chr[c+1], BOTH, 0); | ... | ... |
src/lib3270/session.c
... | ... | @@ -236,8 +236,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char |
236 | 236 | hSession->saved_wraparound_mode = 1; |
237 | 237 | hSession->once_cset = -1; |
238 | 238 | hSession->state = LIB3270_ANSI_STATE_DATA; |
239 | - hSession->cgcsgid = LIB3270_DEFAULT_CGEN | LIB3270_DEFAULT_CSET; | |
240 | - | |
241 | 239 | |
242 | 240 | for(f=0;f<4;f++) |
243 | 241 | hSession->csd[f] = hSession->saved_csd[f] = LIB3270_ANSI_CSD_US; | ... | ... |
src/lib3270/sf.c
... | ... | @@ -945,17 +945,15 @@ static void do_qr_charsets(H3270 *hSession) |
945 | 945 | *hSession->obptr++ = 0x00; /* SUBSN */ |
946 | 946 | } |
947 | 947 | #endif /*]*/ |
948 | - SET32(hSession->obptr, hSession->cgcsgid); /* CGCSGID */ | |
948 | + SET32(hSession->obptr, hSession->charset.cgcsgid); /* CGCSGID */ | |
949 | 949 | if (!*standard_font) |
950 | 950 | { |
951 | 951 | /* special 3270 font, includes APL */ |
952 | 952 | *hSession->obptr++ = 0x01;/* SET 1: */ |
953 | 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 | 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 | 957 | *hSession->obptr++ = 0xf1;/* LCID */ |
960 | 958 | #if defined(X3270_DBCS) /*[*/ |
961 | 959 | if (dbcs) | ... | ... |