From: handa Date: Wed, 14 Jan 2009 07:41:52 +0000 (+0000) Subject: (msymbol__canonicalize): Handle "windows-XXXX". X-Git-Tag: REL-1-5-4~17 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=59fd709ca1cfebcd9dc49a8db84b28b3db9187e2;p=m17n%2Fm17n-lib.git (msymbol__canonicalize): Handle "windows-XXXX". --- diff --git a/src/symbol.c b/src/symbol.c index e25d2dc..71f2dec 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -220,13 +220,14 @@ msymbol__list (MSymbol prop) o convert all uppercase characters to lowercase. o remove all non alpha-numeric characters. o change the leading "ibm" to "cp". - o change the leading "cp" to "ibm" + o change the leading "windows-" to "cp". + o change the leading "cp" to "ibm". o remove the leading "iso". For instance: "ISO-8859-2" -> "88592" "euc-JP" -> "eucjp" "IBM851" -> "cp851" - "CP1250" -> "ibm1250" + "windows-1250" -> "cp250" This function is used to canonicalize charset and coding system names. */ @@ -269,7 +270,15 @@ msymbol__canonicalize (MSymbol sym) canon[1] = 'b'; canon[2] = 'm'; } - + else if (canon[0] == 'w' && p - canon > 7 + && memcmp (canon + 1, "indows", 6) == 0 + && isdigit (canon[7])) + { + /* Change "windowsXXX" to "cpXXX" */ + canon += 5; + canon[0] = 'c'; + canon[1] = 'p'; + } return msymbol (canon); }