Commit cc72c79a1c5563169e0d64124b3aef11de8d47f9
1 parent
40165986
Exists in
master
and in
5 other branches
Trabalhando nas tabelas de charset
Showing
19 changed files
with
41 additions
and
27 deletions
Show diff stats
src/lib3270/ansi.c
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 | #include "hostc.h" |
54 | 54 | #include "screenc.h" |
55 | 55 | // #include "scrollc.h" |
56 | -#include "tablesc.h" | |
56 | +// #include "tablesc.h" | |
57 | 57 | #include "telnetc.h" |
58 | 58 | #include "trace_dsc.h" |
59 | 59 | #include "utf8c.h" |
... | ... | @@ -1045,6 +1045,7 @@ ansi_printing(H3270 *hSession, int ig1 unused, int ig2 unused) |
1045 | 1045 | Boolean preserve_right = False; |
1046 | 1046 | #endif /*]*/ |
1047 | 1047 | |
1048 | +/* | |
1048 | 1049 | if ((hSession->pmi == 0) && (hSession->ansi_ch & 0x80)) { |
1049 | 1050 | char mbs[2]; |
1050 | 1051 | enum ulfail fail; |
... | ... | @@ -1052,27 +1053,29 @@ ansi_printing(H3270 *hSession, int ig1 unused, int ig2 unused) |
1052 | 1053 | |
1053 | 1054 | mbs[0] = (char)hSession->ansi_ch; |
1054 | 1055 | mbs[1] = '\0'; |
1056 | + | |
1055 | 1057 | ch = utf8_lookup(mbs, &fail, NULL); |
1056 | 1058 | if (ch == 0) { |
1057 | 1059 | switch (fail) { |
1058 | 1060 | case ULFAIL_NOUTF8: |
1059 | - /* Leave it alone. */ | |
1061 | + // Leave it alone. | |
1060 | 1062 | break; |
1061 | 1063 | case ULFAIL_INCOMPLETE: |
1062 | - /* Start munching multi-byte. */ | |
1064 | + // Start munching multi-byte. | |
1063 | 1065 | hSession->pmi = 0; |
1064 | 1066 | hSession->pending_mbs[hSession->pmi++] = (char)hSession->ansi_ch; |
1065 | 1067 | return MBPEND; |
1066 | 1068 | case ULFAIL_INVALID: |
1067 | - /* Invalid multi-byte -> '?' */ | |
1069 | + // Invalid multi-byte -> '?' | |
1068 | 1070 | hSession->ansi_ch = '?'; |
1069 | - /* XXX: If DBCS, we should let | |
1070 | - * ICU have a crack at it | |
1071 | - */ | |
1071 | + // XXX: If DBCS, we should let | |
1072 | + // ICU have a crack at it | |
1073 | + // | |
1072 | 1074 | break; |
1073 | 1075 | } |
1074 | 1076 | } |
1075 | 1077 | } |
1078 | + */ | |
1076 | 1079 | hSession->pmi = 0; |
1077 | 1080 | |
1078 | 1081 | if (hSession->held_wrap) |
... | ... | @@ -1216,7 +1219,7 @@ ansi_multibyte(H3270 *hSession, int ig1, int ig2) |
1216 | 1219 | { |
1217 | 1220 | char mbs[MB_MAX]; |
1218 | 1221 | unsigned char ch; |
1219 | - enum ulfail fail; | |
1222 | +// enum ulfail fail; | |
1220 | 1223 | afn_t fn; |
1221 | 1224 | |
1222 | 1225 | if (hSession->pmi >= MB_MAX - 2) |
... | ... | @@ -1231,6 +1234,7 @@ ansi_multibyte(H3270 *hSession, int ig1, int ig2) |
1231 | 1234 | mbs[hSession->pmi] = (char) hSession->ansi_ch; |
1232 | 1235 | mbs[hSession->pmi + 1] = '\0'; |
1233 | 1236 | |
1237 | + /* | |
1234 | 1238 | ch = utf8_lookup(mbs, &fail, NULL); |
1235 | 1239 | if (ch != 0) |
1236 | 1240 | { |
... | ... | @@ -1245,6 +1249,7 @@ ansi_multibyte(H3270 *hSession, int ig1, int ig2) |
1245 | 1249 | hSession->pending_mbs[hSession->pmi++] = (char)hSession->ansi_ch; |
1246 | 1250 | return MBPEND; |
1247 | 1251 | } |
1252 | + */ | |
1248 | 1253 | |
1249 | 1254 | /* Failure. */ |
1250 | 1255 | ... | ... |
src/lib3270/charset.c
... | ... | @@ -213,6 +213,9 @@ LIB3270_EXPORT struct lib3270_charset * lib3270_load_charset(H3270 *hSession, co |
213 | 213 | hSession->charset.host = "bracket"; |
214 | 214 | hSession->charset.display = "ISO-8859-1"; |
215 | 215 | |
216 | + lib3270_write_log(hSession,"charset","host.charset=%s display.charset=%s", | |
217 | + hSession->charset.host,hSession->charset.display); | |
218 | + | |
216 | 219 | memcpy(hSession->charset.ebc2asc, ebc2asc0, sizeof(hSession->charset.ebc2asc)); |
217 | 220 | memcpy(hSession->charset.asc2ebc, asc2ebc0, sizeof(hSession->charset.asc2ebc)); |
218 | 221 | ... | ... |
src/lib3270/charset.h
... | ... | @@ -33,6 +33,9 @@ |
33 | 33 | |
34 | 34 | #define LIB3270_CHARSET_H_INCLUDED 1 |
35 | 35 | |
36 | + LIB3270_INTERNAL const unsigned short ebc2asc0[256]; | |
37 | + LIB3270_INTERNAL const unsigned short asc2ft0[256]; | |
38 | + | |
36 | 39 | const struct lib3270_charset lib3270_default_charset; |
37 | 40 | |
38 | 41 | LIB3270_EXPORT struct lib3270_charset * lib3270_load_charset(H3270 *hSession, const char *name); | ... | ... |
src/lib3270/ctlr.c
src/lib3270/ft.c
src/lib3270/ft_cut.c
src/lib3270/ft_dft.c
src/lib3270/glue.c
src/lib3270/kybd.c
src/lib3270/paste.c
src/lib3270/rpq.c
src/lib3270/screen.c
src/lib3270/see.c
src/lib3270/session.c
src/lib3270/sf.c
src/lib3270/sources.mak
... | ... | @@ -26,10 +26,12 @@ |
26 | 26 | |
27 | 27 | # Terminal only sources |
28 | 28 | TERMINAL_SOURCES = bounds.c ctlr.c util.c toggles.c screen.c selection.c kybd.c telnet.c \ |
29 | - host.c sf.c ansi.c resolver.c tables.c utf8.c charset.c \ | |
29 | + host.c sf.c ansi.c resolver.c charset.c \ | |
30 | 30 | version.c session.c state.c html.c trace_ds.c see.c \ |
31 | 31 | paste.c |
32 | 32 | |
33 | +# tables.c utf8.c | |
34 | + | |
33 | 35 | # Network I/O Sources |
34 | 36 | NETWORK_SOURCES = iocalls.c proxy.c |
35 | 37 | ... | ... |
src/lib3270/tablesc.h
... | ... | @@ -16,8 +16,11 @@ |
16 | 16 | * tablesc.h |
17 | 17 | * Global declarations for tables.c. |
18 | 18 | */ |
19 | -LIB3270_INTERNAL void initialize_tables(H3270 *hSession); | |
20 | -LIB3270_INTERNAL void charset_defaults(H3270 *hSession); | |
19 | + | |
20 | +#error Deprecated, replace for charset.h | |
21 | + | |
22 | +// LIB3270_INTERNAL void initialize_tables(H3270 *hSession); | |
23 | +// LIB3270_INTERNAL void charset_defaults(H3270 *hSession); | |
21 | 24 | |
22 | 25 | // LIB3270_INTERNAL unsigned short ebc2cg[256]; |
23 | 26 | // LIB3270_INTERNAL unsigned short cg2ebc[256]; |
... | ... | @@ -36,9 +39,7 @@ LIB3270_INTERNAL void charset_defaults(H3270 *hSession); |
36 | 39 | // LIB3270_INTERNAL const unsigned short cg2asc[256]; |
37 | 40 | // LIB3270_INTERNAL const unsigned short ebc2cg0[256]; |
38 | 41 | // LIB3270_INTERNAL const unsigned short cg2ebc0[256]; |
39 | - LIB3270_INTERNAL const unsigned short ebc2asc0[256]; | |
40 | 42 | // LIB3270_INTERNAL const unsigned short asc2ebc0[256]; |
41 | 43 | // LIB3270_INTERNAL const unsigned short asc2uc[256]; |
42 | 44 | // LIB3270_INTERNAL const unsigned short ebc2uc[256]; |
43 | 45 | // LIB3270_INTERNAL const unsigned short ft2asc0[256]; |
44 | - LIB3270_INTERNAL const unsigned short asc2ft0[256]; | ... | ... |
src/lib3270/telnet.c
src/lib3270/trace_ds.c