成瀬です。

手元の環境を眺めつつ、色々と replica や alias を設定してみました。現在指
定可能なエンコーディングは以下のとおりです。ISO 8859 シリーズはとりあえ
ずそれっぽいのの replica にしているので間違っていたら教えてください。
(Windows-1251 は なんか間違えた気がする・・・)
"ASCII" is original encoding
"EUC-JP" is original encoding
"ISO-8859-1" is original encoding
"ISO-8859-10" is original encoding
"ISO-8859-11" is original encoding
"ISO-8859-13" is original encoding
"ISO-8859-14" is original encoding
"ISO-8859-15" is original encoding
"ISO-8859-16" is original encoding
"ISO-8859-2" is original encoding
"ISO-8859-3" is original encoding
"ISO-8859-4" is original encoding
"ISO-8859-5" is original encoding
"ISO-8859-6" is original encoding
"ISO-8859-7" is original encoding
"ISO-8859-8" is original encoding
"ISO-8859-9" is original encoding
"Shift_JIS" is original encoding
"US-ASCII" is original encoding
"UTF-8" is original encoding
"UTF-16BE" is original encoding
"UTF-16LE" is original encoding
"UTF-32BE" is original encoding
"UTF-32LE" is original encoding
""Windows-1255" is replica of "ISO-8859-8"
"Windows-1256" is replica of "ISO-8859-6"
"Windows-1257" is replica of "ISO-8859-4"
"Windows-874" is replica of "ISO-8859-11"
"CP51932" is replica of "EUC-JP"
"eucJP-ms" is replica of "EUC-JP"
"Windows-31J" is replica of "Shift_JIS"
"Windows-1251" is replica of "ISO-8859-5"
"Windowws-1250" is replica of "ISO-8859-2"
"Windows-1252" is replica of "ISO-8859-1"
"Windows-1253" is replica of "ISO-8859-7"
"Windows-1254" is replica of "ISO-8859-9"
"CP932" is alias of "Windows-31J"
"ISO8859-6" is alias of "ISO-8859-6"
"ISO8859-14" is alias of "ISO-8859-14"
"CP1252" is alias of "Windows-1252"
"SJIS" is alias of "Shift_JIS"
"CP1253" is alias of "Windows-1253"
"ISO8859-7" is alias of "ISO-8859-7"
"ISO8859-15" is alias of "ISO-8859-15"
"BINARY" is alias of "ASCII-8BIT"
"646" is alias of "US-ASCII"
"CP1254" is alias of "Windows-1254"
"ISO8859-8" is alias of "ISO-8859-8"
"ISO8859-16" is alias of "ISO-8859-16"
"ISO8859-9" is alias of "ISO-8859-9"
"CP1255" is alias of "Windows-1255"
"eucJP" is alias of "EUC-JP"
"ANSI_X3.4-1986" is alias of "US-ASCII"
"CP1256" is alias of "Windows-1256"
"CP1257" is alias of "Windows-1257"
"ASCII" is alias of "US-ASCII"
"ISO8859-1" is alias of "ISO-8859-1"
"csWindows31J" is alias of "Windows-31J"
"ISO8859-2" is alias of "ISO-8859-2"
"ISO8859-10" is alias of "ISO-8859-10"
"ISO8859-3" is alias of "ISO-8859-3"
"CP874" is alias of "ISO-8859-11"
"ISO8859-11" is alias of "ISO-8859-11"
"euc-jp-ms" is alias of "EUC-JP"
"ISO8859-4" is alias of "ISO-8859-4"
"CP1250" is alias of "Windows-1250"
"CP1251" is alias of "Windows-1251"
"ISO8859-5" is alias of "ISO-8859-5"
"ISO8859-13" is alias of "ISO-8859-13"

未登録なもののうち、鬼車がサポートしているのは、以下の通り。
bg_BG.CP1251   Bulgarian Cyrillic character set (CP1251), CODESET=CP1251
ko_KR.eucKR    1 0x0000 2 0x8080 2 0x0080 3 0x8000 0x8080 CODESET=eucKR
ru_RU.KOI8-R   Russian CODESET=KOI8-R
zh_CN.GB18030  CODESET=GB18030
zh_CN.eucCN    1 0x0000 2 0x8080 2 0x0080 3 0x8000 0x8080 CODESET=eucCN
zh_TW.BIG5     CODESET=BIG5
zh_TW.eucTW    CODESET=eucTW

KOI8-U は KOI8 の replica なのか別物なのかがわかりませんでした。なにか影
響あるのかな。
uk_UA.KOI8-U   Ukrainian CODESET=KOI8-U character set

あと以下のエンコーディングがありましたが、これはサポートする必要あるので
すかね?なんかなさそう。
ru_RU.CP866      Russian Alternative charset, CODESET=CP866
kk_KZ.PT154      PT154 character set,CODESET=PT154
hy_AM.ARMSCII-8  Armenian ARMSCII-8 character set, CODESET=ARMSCII-8
ru_RU.CP866      Russian Alternative charset, CODESET=CP866


ところで、現在 rb_locale_encoding は locale_charmap が nil だと
ASCII-8BIT を返しますが、POSIX 的にいえば nil = C なわけで、US-ASCII を
返すのはどうでしょう。また、未登録の名前が来たときは dummy を返しませんか。

Index: encoding.c
===================================================================
--- encoding.c  (revision 15025)
+++ encoding.c  (working copy)
@@ -872,13 +872,14 @@ rb_locale_encoding(void)
 {
     VALUE charmap = rb_locale_charmap(rb_cEncoding);
     int idx;
+    char *name;

-    if (NIL_P(charmap))
-        return rb_ascii8bit_encoding();
+    if (NIL_P(charmap)) name = "US-ASCII";
+    else name = StringValueCStr(charmap)

-    idx = rb_enc_find_index(StringValueCStr(charmap));
+    idx = rb_enc_find_index(name);
     if (idx < 0)
-        return rb_ascii8bit_encoding();
+        idx = rb_define_dummy_encoding(name);

     return rb_enc_from_index(idx);
 }

-- 
NARUSE, Yui  <naruse / airemix.com>
DBDB A476 FDBD 9450 02CD 0EFC BCE3 C388 472E C1EA