X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/charset/blobdiff_plain/b97e542708b7c9ebd09991420fbbf6785d5ccd87..HEAD:/localenc.c diff --git a/localenc.c b/localenc.c index 4be2a39..f5fabee 100644 --- a/localenc.c +++ b/localenc.c @@ -28,6 +28,7 @@ static const struct { } localencs[] = { { "", CS_NONE, 0 }, { "ASCII", CS_ASCII, 1 }, + { "BS 4730", CS_BS4730, 1 }, { "ISO-8859-1", CS_ISO8859_1, 1 }, { "ISO-8859-1 with X11 line drawing", CS_ISO8859_1_X11, 0 }, { "ISO-8859-2", CS_ISO8859_2, 1 }, @@ -46,6 +47,11 @@ static const struct { { "ISO-8859-16", CS_ISO8859_16, 1 }, { "CP437", CS_CP437, 1 }, { "CP850", CS_CP850, 1 }, + { "CP852", CS_CP852, 1 }, + { "CP866", CS_CP866, 1 }, + { "CP874", CS_CP874, 1 }, + { "Win874", CS_CP874, 0 }, + { "Win-874", CS_CP874, 0 }, { "CP1250", CS_CP1250, 1 }, { "Win1250", CS_CP1250, 0 }, { "CP1251", CS_CP1251, 1 }, @@ -94,12 +100,16 @@ static const struct { { "VISCII", CS_VISCII, 1 }, { "HP ROMAN8", CS_HP_ROMAN8, 1 }, { "DEC MCS", CS_DEC_MCS, 1 }, + { "DEC graphics", CS_DEC_GRAPHICS, 1 }, + { "DEC-graphics", CS_DEC_GRAPHICS, 0 }, + { "DECgraphics", CS_DEC_GRAPHICS, 0 }, { "UTF-8", CS_UTF8, 1 }, { "UTF-7", CS_UTF7, 1 }, { "UTF-7-conservative", CS_UTF7_CONSERVATIVE, 0 }, { "EUC-CN", CS_EUC_CN, 1 }, { "EUC-KR", CS_EUC_KR, 1 }, { "EUC-JP", CS_EUC_JP, 1 }, + { "EUC-TW", CS_EUC_TW, 1 }, { "ISO-2022-JP", CS_ISO2022_JP, 1 }, { "ISO-2022-KR", CS_ISO2022_KR, 1 }, { "Big5", CS_BIG5, 1 }, @@ -110,6 +120,7 @@ static const struct { { "UTF-16", CS_UTF16, 1 }, { "CP949", CS_CP949, 1 }, { "PDFDocEncoding", CS_PDF, 1 }, + { "StandardEncoding", CS_PSSTD, 1 }, { "COMPOUND_TEXT", CS_CTEXT, 1 }, { "COMPOUND-TEXT", CS_CTEXT, 0 }, { "COMPOUND TEXT", CS_CTEXT, 0 }, @@ -138,13 +149,15 @@ int charset_from_localenc(const char *name) return i; if ( (i = charset_from_xenc(name)) != CS_NONE) return i; + if ( (i = charset_from_emacsenc(name)) != CS_NONE) + return i; for (i = 0; i < (int)lenof(localencs); i++) { const char *p, *q; p = name; q = localencs[i].name; while (*p || *q) { - if (tolower(*p) != tolower(*q)) + if (tolower((unsigned char)*p) != tolower((unsigned char)*q)) break; p++; q++; }