📄 lycharsets.c
字号:
} else if (!strncmp(LYchar_set_names[i], "ISO Latin 1", 11) || !strncmp(LYchar_set_names[i], "Chinese", 7) || !strncmp(LYchar_set_names[i], "Japanese (EUC)", 14) || !strncmp(LYchar_set_names[i], "Japanese (SJIS)", 15) || !strncmp(LYchar_set_names[i], "Korean", 6) || !strncmp(LYchar_set_names[i], "Taipei (Big5)", 13)) { if (modeflag == TRUE) { LYUseDefaultRawMode = TRUE; } else { LYUseDefaultRawMode = FALSE; } } else { if (modeflag == FALSE) { LYUseDefaultRawMode = TRUE; } else { LYUseDefaultRawMode = FALSE; } } return;}/* * Function to set the LYHaveCJKCharacterSet value * based on the selected character set. - FM */PUBLIC void HTMLSetHaveCJKCharacterSet ARGS1(int,i){ if (!strncmp(LYchar_set_names[i], "Chinese", 7) || !strncmp(LYchar_set_names[i], "Japanese (EUC)", 14) || !strncmp(LYchar_set_names[i], "Japanese (SJIS)", 15) || !strncmp(LYchar_set_names[i], "Korean", 6) || !strncmp(LYchar_set_names[i], "Taipei (Big5)", 13)) { LYHaveCJKCharacterSet = TRUE; } else { LYHaveCJKCharacterSet = FALSE; } return;}/* * Entity names -- Ordered by ISO Latin 1 value. * --------------------------------------------- * For conversions of DECIMAL escaped entities. * Must be in order of ascending value. */PUBLIC CONST char * LYEntityNames[] = {/* NAME DECIMAL VALUE */ "nbsp", /* 160, non breaking space */ "iexcl", /* 161, inverted exclamation mark */ "cent", /* 162, cent sign */ "pound", /* 163, pound sign */ "curren", /* 164, currency sign */ "yen", /* 165, yen sign */ "brvbar", /* 166, broken vertical bar, (brkbar) */ "sect", /* 167, section sign */ "uml", /* 168, spacing dieresis */ "copy", /* 169, copyright sign */ "ordf", /* 170, feminine ordinal indicator */ "laquo", /* 171, angle quotation mark, left */ "not", /* 172, negation sign */ "shy", /* 173, soft hyphen */ "reg", /* 174, circled R registered sign */ "hibar", /* 175, spacing macron */ "deg", /* 176, degree sign */ "plusmn", /* 177, plus-or-minus sign */ "sup2", /* 178, superscript 2 */ "sup3", /* 179, superscript 3 */ "acute", /* 180, spacing acute (96) */ "micro", /* 181, micro sign */ "para", /* 182, paragraph sign */ "middot", /* 183, middle dot */ "cedil", /* 184, spacing cedilla */ "sup1", /* 185, superscript 1 */ "ordm", /* 186, masculine ordinal indicator */ "raquo", /* 187, angle quotation mark, right */ "frac14", /* 188, fraction 1/4 */ "frac12", /* 189, fraction 1/2 */ "frac34", /* 190, fraction 3/4 */ "iquest", /* 191, inverted question mark */ "Agrave", /* 192, capital A, grave accent */ "Aacute", /* 193, capital A, acute accent */ "Acirc", /* 194, capital A, circumflex accent */ "Atilde", /* 195, capital A, tilde */ "Auml", /* 196, capital A, dieresis or umlaut mark */ "Aring", /* 197, capital A, ring */ "AElig", /* 198, capital AE diphthong (ligature) */ "Ccedil", /* 199, capital C, cedilla */ "Egrave", /* 200, capital E, grave accent */ "Eacute", /* 201, capital E, acute accent */ "Ecirc", /* 202, capital E, circumflex accent */ "Euml", /* 203, capital E, dieresis or umlaut mark */ "Igrave", /* 204, capital I, grave accent */ "Iacute", /* 205, capital I, acute accent */ "Icirc", /* 206, capital I, circumflex accent */ "Iuml", /* 207, capital I, dieresis or umlaut mark */ "ETH", /* 208, capital Eth, Icelandic (or Latin2 Dstrok) */ "Ntilde", /* 209, capital N, tilde */ "Ograve", /* 210, capital O, grave accent */ "Oacute", /* 211, capital O, acute accent */ "Ocirc", /* 212, capital O, circumflex accent */ "Otilde", /* 213, capital O, tilde */ "Ouml", /* 214, capital O, dieresis or umlaut mark */ "times", /* 215, multiplication sign */ "Oslash", /* 216, capital O, slash */ "Ugrave", /* 217, capital U, grave accent */ "Uacute", /* 218, capital U, acute accent */ "Ucirc", /* 219, capital U, circumflex accent */ "Uuml", /* 220, capital U, dieresis or umlaut mark */ "Yacute", /* 221, capital Y, acute accent */ "THORN", /* 222, capital THORN, Icelandic */ "szlig", /* 223, small sharp s, German (sz ligature) */ "agrave", /* 224, small a, grave accent */ "aacute", /* 225, small a, acute accent */ "acirc", /* 226, small a, circumflex accent */ "atilde", /* 227, small a, tilde */ "auml", /* 228, small a, dieresis or umlaut mark */ "aring", /* 229, small a, ring */ "aelig", /* 230, small ae diphthong (ligature) */ "ccedil", /* 231, small c, cedilla */ "egrave", /* 232, small e, grave accent */ "eacute", /* 233, small e, acute accent */ "ecirc", /* 234, small e, circumflex accent */ "euml", /* 235, small e, dieresis or umlaut mark */ "igrave", /* 236, small i, grave accent */ "iacute", /* 237, small i, acute accent */ "icirc", /* 238, small i, circumflex accent */ "iuml", /* 239, small i, dieresis or umlaut mark */ "eth", /* 240, small eth, Icelandic */ "ntilde", /* 241, small n, tilde */ "ograve", /* 242, small o, grave accent */ "oacute", /* 243, small o, acute accent */ "ocirc", /* 244, small o, circumflex accent */ "otilde", /* 245, small o, tilde */ "ouml", /* 246, small o, dieresis or umlaut mark */ "divide", /* 247, division sign */ "oslash", /* 248, small o, slash */ "ugrave", /* 249, small u, grave accent */ "uacute", /* 250, small u, acute accent */ "ucirc", /* 251, small u, circumflex accent */ "uuml", /* 252, small u, dieresis or umlaut mark */ "yacute", /* 253, small y, acute accent */ "thorn", /* 254, small thorn, Icelandic */ "yuml", /* 255, small y, dieresis or umlaut mark */};/* * Function to return the entity names of * ISO-8859-1 8-bit characters. - FM */PUBLIC CONST char * HTMLGetEntityName ARGS1( UCode_t, code){#define IntValue code int MaxValue = ((sizeof(LYEntityNames)/sizeof(char **)) - 1); if (IntValue < 0 || IntValue > MaxValue) { return ""; } return LYEntityNames[IntValue];}/* * Function to return the UCode_t (long int) value for entity names * in the ISO_Latin1 and UC_entity_info unicode_entities arrays. * It returns 0 if not found. - FM * * unicode_entities[] now handles all the names from old style entities[] too. * Lynx now calls unicode_entities[] only through this function: * HTMLGetEntityUCValue(). Note, we need not check for special characters * here in function or even before it, we should check them *after* * invoking this function, see put_special_unicodes() in SGML.c. * * In the future we will try to isolate all calls to entities[] * in favor of new unicode-based chartrans scheme. - LP */PUBLIC UCode_t HTMLGetEntityUCValue ARGS1( CONST char *, name){ UCode_t value = 0; size_t i, high, low; int diff = 0;/* CONST char ** entities = HTML_dtd.entity_names; */ CONST UC_entity_info * unicode_entities = HTML_dtd.unicode_entity_info; /* * Make sure we have a non-zero length name. - FM */ if (!(name && *name)) return(value);#ifdef NOTDEFINED/*** unicode_entities[] now handles all names from entities[], so disable latter.** Let us keep this some sort of comment until we remove** all calls to old-style entities[] from the code. - LP*/ /* * Handle names that have control characters * or strings in ISO_Latin1[]. - FM */ if (!strcmp(name, "nbsp")) { return(160); } if (!strcmp(name, "shy")) { return(173); } if (!strcmp(name, "ensp")) { return(8194); } if (!strcmp(name, "emsp")) { return(8195); } if (!strcmp(name, "thinsp")) { return(8201); } if (!strcmp(name, "ndash") || !strcmp(name, "endash")) { return(8211); } if (!strcmp(name, "mdash") || !strcmp(name, "emdash")) { return(8212); } if (!strcmp(name, "trade")) { return(8482); } /* * Now try ISO_Latin1[]. - FM */ for (low = 0, high = HTML_dtd.number_of_entities; high > low; diff < 0 ? (low = i+1) : (high = i)) { /* ** Binary search. */ i = (low + (high-low)/2); diff = strcmp(entities[i], name); if (diff == 0) { if (strlen(ISO_Latin1[i]) == 1) { value = (unsigned char)(ISO_Latin1[i][0]); } break; } } if (value > 0) { return(value); } /* * Not yet found... - FM */#endif /* NOTDEFINED */ /* * Try UC_entity_info unicode_entities[]. */ for (low = 0, high = HTML_dtd.number_of_unicode_entities; high > low; diff < 0 ? (low = i+1) : (high = i)) { /* ** Binary search. */ i = (low + (high-low)/2); diff = strcmp(unicode_entities[i].name, name); /* Case sensitive! */ if (diff == 0) { value = unicode_entities[i].code; break; } } return(value);}/* * Function to select a character set and then set the * character handling and LYHaveCJKCharacterSet flag. - FM */PUBLIC void HTMLUseCharacterSet ARGS1(int,i){ p_entity_values = LYCharSets[i]; HTMLSetCharacterHandling(i); HTMLSetHaveCJKCharacterSet(i); return;}/* * Initializer, calls initialization function for the * CHARTRANS handling. - KW */PUBLIC int LYCharSetsDeclared NOPARAMS{ UCInit(); if (UCAssume_MIMEcharset && *UCAssume_MIMEcharset) { UCLYhndl_for_unspec = UCGetLYhndl_byMIME(UCAssume_MIMEcharset); } else { UCLYhndl_for_unspec = 0; } if (UCAssume_localMIMEcharset && *UCAssume_localMIMEcharset) UCLYhndl_HTFile_for_unspec = UCGetLYhndl_byMIME(UCAssume_localMIMEcharset); if (UCAssume_unrecMIMEcharset && *UCAssume_unrecMIMEcharset) UCLYhndl_for_unrec = UCGetLYhndl_byMIME(UCAssume_unrecMIMEcharset); return UCInitialized;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -