diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1998-11-10 19:47:00 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1998-11-10 19:47:00 -0500 |
commit | d3f9d5478df478427c2aa5db4507ddd0a38f0eb6 (patch) | |
tree | e27eacd6bbda653dd77f11cc020b9e0a59f7f4fc /src/UCAux.c | |
parent | 18024037b515bfff83e0230b35151babe6005e18 (diff) | |
download | lynx-snapshots-d3f9d5478df478427c2aa5db4507ddd0a38f0eb6.tar.gz |
snapshot of project "lynx", label v2-8-2dev_2
Diffstat (limited to 'src/UCAux.c')
-rw-r--r-- | src/UCAux.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/UCAux.c b/src/UCAux.c index 3a8bc56d..6847b150 100644 --- a/src/UCAux.c +++ b/src/UCAux.c @@ -1,5 +1,4 @@ #include <HTUtils.h> -#include <tcp.h> #include <HTCJK.h> #include <UCDefs.h> @@ -38,9 +37,9 @@ PUBLIC BOOL UCCanTranslateFromTo ARGS2( return YES; if (from < 0 || to < 0) return NO; - if (from == 0) + if (from == LATIN1) return UCCanTranslateUniTo(to); - if (to == 0 || LYCharSet_UC[to].enc == UCT_ENC_UTF8) + if (to == LATIN1 || LYCharSet_UC[to].enc == UCT_ENC_UTF8) return UCCanUniTranslateFrom(from); { CONST char * fromname = LYCharSet_UC[from].MIMEname; @@ -103,7 +102,7 @@ PUBLIC BOOL UCNeedNotTranslate ARGS2( } if (to < 0) return NO; /* ??? */ - if (to == 0) { + if (to == LATIN1) { if (LYCharSet_UC[from].codepoints & (UCT_CP_SUBSETOF_LAT1)) return YES; } @@ -114,7 +113,7 @@ PUBLIC BOOL UCNeedNotTranslate ARGS2( if (LYCharSet_UC[to].enc == UCT_ENC_UTF8) { return NO; } - if (from == 0) { + if (from == LATIN1) { if (LYCharSet_UC[from].codepoints & (UCT_CP_SUPERSETOF_LAT1)) return YES; } @@ -122,14 +121,7 @@ PUBLIC BOOL UCNeedNotTranslate ARGS2( if (HTCJK == NOCJK) /* Use that global flag, for now. */ return NO; if (HTCJK == JAPANESE && - /* - ** Always strip the "x-" from "x-euc-jp", - ** or convert "x-shift-jis" to "shift_jis", - ** before calling this function, and so - ** don't check for them here. - FM - */ (!strcmp(fromname, "euc-jp") || - !strncmp(fromname, "iso-2022-jp",11) || !strcmp(fromname, "shift_jis"))) return YES; /* ??? */ return NO; /* If not handled by (from == to) above. */ @@ -186,7 +178,7 @@ PUBLIC void UCSetTransParams ARGS5( pT->trans_C0_to_uni = (p_in->enc == UCT_ENC_8BIT_C0 || p_out->enc == UCT_ENC_8BIT_C0); } else { - /* + /* ** Initialize local flags. - FM */ BOOL intm_ucs = FALSE; @@ -223,7 +215,7 @@ PUBLIC void UCSetTransParams ARGS5( ** equivalent to them, i.e. if we have UCS without ** having to do a table translation. */ - intm_ucs = (cs_in == 0 || pT->decode_utf8 || + intm_ucs = (cs_in == LATIN1 || pT->decode_utf8 || (p_in->codepoints & (UCT_CP_SUBSETOF_LAT1|UCT_CP_SUBSETOF_UCS2))); /* @@ -278,7 +270,7 @@ PUBLIC void UCSetTransParams ARGS5( */ pT->use_raw_char_in = (!pT->output_utf8 && cs_in == cs_out && - !pT->trans_C0_to_uni); + !pT->trans_C0_to_uni); /* ** This should be set TRUE when we expect to have ** done translation to Unicode or had the equivalent @@ -413,7 +405,7 @@ PUBLIC BOOL UCConvertUniToUtf8 ARGS2( if (code <= 0 || code > 0x7fffffffL) { *ch = '\0'; - return NO; + return NO; } if (code < 0x800L) { |