X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/6d177721a1a7749eb0d713fc6768fc758a83e2ab..HEAD:/charset/localenc.c diff --git a/charset/localenc.c b/charset/localenc.c index 4d81f50f..a24126d3 100644 --- a/charset/localenc.c +++ b/charset/localenc.c @@ -21,6 +21,7 @@ static const struct { int return_in_enum; /* enumeration misses some charsets */ } localencs[] = { { "", CS_NONE, 0 }, + { "UTF-8", CS_UTF8, 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 }, @@ -39,6 +40,7 @@ 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 }, { "CP1250", CS_CP1250, 1 }, { "CP1251", CS_CP1251, 1 }, @@ -74,7 +76,6 @@ static const struct { { "VISCII", CS_VISCII, 1 }, { "HP ROMAN8", CS_HP_ROMAN8, 1 }, { "DEC MCS", CS_DEC_MCS, 1 }, - { "UTF-8", CS_UTF8, 1 }, }; const char *charset_to_localenc(int charset) @@ -102,7 +103,7 @@ int charset_from_localenc(const char *name) 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++; }