Open() and encodings

成瀬です。

Dir.open/entries に関連して、open() 絡みの変更案です。

まず、ファイルパスについて、現在はファイルシステムのエンコーディングに関らず、
与えられたバイナリ列をそのままOSに渡していますが、
ファイルシステムのエンコーディングに変換した上で渡した方が親切でしょう。

次に、現在open()はエンコーディングを別にオプションで取ることができません。
これも
open(“filename”, internal_encoding:“EUC-JP”,
external_encoding:“Shift_JIS”)
などと取れたほうが便利ではないでしょうか。
なお、キー名はとりあえずそのまんま長めの名前にしています。
これならば誤解はないであろうし、後でもっと良い名前を思いついたときに変えやすいと思ったので。

このような感じでいかがでしょうか。

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34923] open() and encodings”
on Wed, 4 Jun 2008 08:08:54 +0900, “NARUSE, Yui” [email protected]
writes:

|Dir.open/entries e$B$K4XO"$7$F!"e(Bopen() e$BMm$$NJQ990F$G$9!#e(B
|
|e$B$^$:!"%U%!%$%k%Q%9$K$D$$$F!"8=:
$O%U%!%$%k%7%9%F%$N%(%s%3!<%G%#%s%0$K4X$i$:!"e(B |e$BM?$($i$l$?%P%$%J%jNs$r$=$N$^$^e(BOSe$B$KEO$7$F$$$^$9$,!"e(B |e$B%U%!%$%k%7%9%F%$N%(%s%3!<%G%#%s%0$KJQ49$7$?>e$GEO$7$?J}$,[email protected]$G$7$g$&!#e(B

e$B!V%U%!%$%k%7%9%F%`$N%(%s%3!<%G%#%s%0!W$C$FJQ49$7$FEO$;$k$[$Ie(B
e$B?.Mj$G$-$k$b$N$J$s$G$7$g$&$+!#JQ49$C$F$N$O4V0c$C$F$k$HCWL?E*e(B
e$B$G$9$+$i!#e(B

Windowse$B$de(BOSXe$B$G$O$=$&$J$N$+$b$7$l$^$;$s$,!“e(BUNIXe$B$G$O$+$J$i$:$7e(B
e$B$b$=$&$G$b$J$$$h$&$J!#$3$N%Q%C%A$G$Oe(Blocalee$B$r:NMQ$7$F$$$k$h$&e(B
e$B$G$9$,!”$R$H$D$N%U%!%$%k%7%9%F%$GJ#?t$N%(%s%3!<%G%#%s%0$,:.e(B e$B:_$7$F$$$k>l9g$b$"$j$^$9$+$i!"[email protected]<(E*$K%(%s%3!<%G%#%s%0$,;XDje(B e$B$G$-$J$$$H$^$:$$$G$9!#$H$$$&$+!"$$7$m:G=i$+$iJQ49$7$F$[$7$/e(B
e$B$"$j$^$;$s!#e(B

|e$B<!$K!“8=:_e(Bopen()e$B$O%(%s%3!<%G%#%s%0$rJL$K%%W%7%g%s$G<h$k$3$H$,$G$-$^$;$s!#e(B
|e$B$3$l$be(B
|open(“filename”, internal_encoding:“EUC-JP”, external_encoding:“Shift_JIS”)
|e$B$J$I$H<h$l$?$[$&$,JXMx$G$O$J$$$G$7$g$&$+!#e(B
|e$B$J$
!”%-!$O$H$j$"$($:$=$N$^$s$^D9$a$NL>A0$K$7$F$$$^$9!#e(B
|e$B$3$l$J$i$P8m2r$O$J$$$G$"$m$&$7!"8e$G$b$C$HNI$$L>A0$r;W$$$D$$$?$H$-$KJQ$($d$9$$$H;W$C$?$N$G!#e(B

e$B$(!<$H!“e(BIO.reade$B$J$I$NN`?d$+$i$$$($P!”$^$:e(B

open(“filename”, encoding: “EUC-JP:Shift_JIS”)

e$B$NF3F~$,@[email protected]$m$&$H;W$$$^$9!#$G!“e(Binternal_encodinge$B$J$I$KH?BPe(B
e$B$9$k$o$1$G$O$”$j$^$;$s$,!"$=$N>l9g$K$Oe(Bopen_key_argse$B$bF1$8%*e(B
e$B%W%7%g%s$r<u$1IU$1$k$Y$-$G$7$g$&$M!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

成瀬です。

Yukihiro M. wrote:

「ファイルシステムのエンコーディング」って変換して渡せるほど
ä¿¡é ¼ã§ãã‚‹ã‚‚ã®ãªã‚“ã§ã—ã‚‡ã†ã‹ã€‚å¤‰æ›ã£ã¦ã®ã¯é–“é•ã£ã¦ã‚‹ã¨è‡´å‘½çš„
ですから。

変換で間違えて読めないのは、実際はそこまで致命的ではないと思うのです。
そのようなケースではどのみちどこかで変換したであろうはずで、
ã“ã®å ´åˆã©ã“ã§å¤‰æ›ã—ã¦ã‚‚æ³¨æ„æ·±ãã—ãªã„ã¨èª­ã‚ãªã„ã‚‚ã®ã¯èª­ã‚ãªã„ã‚ã‘ã§ã™ã€‚
ならば、読めるものは楽に読めた方がいいであろうと。

ã©ã¡ã‚‰ã‹ã¨ã„ãˆã°æ°—ã«ã—ã¦ã„ãŸã®ã¯èª­ã‚ã¦ã¯ãªã‚‰ãªã„ã‚‚ã®ã‚’èª­ã‚ã¦ã—ã¾ã†å ´åˆã§ã—ãŸãŒã€
ã“ã¡ã‚‰ã‚‚çµå±€å¤‰æ›ãŒå¿…è¦ãªå ´åˆã«ãŠã‘ã‚‹è„…å¨ã¯å¢—æ¸›ã—ãªã„ã§ã‚ã‚ã†ã¨ã„ã†è¦‹è§£ã§ã™ã€‚

WindowsやOSXではそうなのかもしれませんが、UNIXではかならずし
もそうでもないような。このパッチではlocaleを採用しているよう
ですが、ひとつのファイルシステムで複数のエンコーディングが混
åœ¨ã—ã¦ã„ã‚‹å ´åˆã‚‚ã‚ã‚Šã¾ã™ã‹ã‚‰ã€æ˜Žç¤ºçš„ã«ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ãŒæŒ‡å®š
できないとまずいです。というか、むしろ最初から変換してほしく
ありません。

こちらはUNIXにおけるデフォルトがlocaleでは適切とは言えない、
ということでしょうか。
確かに、RedHat系ですと事実上UTF-8がファイルシステムのエンコーディングと言える
であろう一方で(正確には/etc/sysconfig/i18nで指定)、
Debianや*BSDではシステム全体のエンコーディングはおそらく決定できません。

と、すると、デフォルトは ASCII-8BIT あたりにして変換しない方がいいのですかねぇ。

の導入が先だろうと思います。で、internal_encodingなどに反対
ã™ã‚‹ã‚ã‘ã§ã¯ã‚ã‚Šã¾ã›ã‚“ãŒã€ãã®å ´åˆã«ã¯open_key_argsも同じオ
プションを受け付けるべきでしょうね。

なるほど。
そのように変更してみました。

In article [email protected],
“NARUSE, Yui” [email protected] writes:

e$BJQ49$G4V0c$($FFI$a$J$$$N$O!"<B:]$O$=$3$^$GCWL?E*$G$O$J$$$H;W$&$N$G$9!#e(B
e$B$=$N$h$&$J%1!<%9$G$O$I$N$_$A$I$3$+$GJQ49$7$?$G$"$m$&$O$:$G!"e(B
e$B$3$N>l9g$I$3$GJQ49$7$F$bCm0U?<$/$7$J$$$HFI$a$J$$$b$N$OFI$a$J$$$o$1$G$9!#e(B
e$B$J$i$P!“FI$a$k$b$N$O3Z$KFI$a$?J}$,$$$$$G$”$m$&$H!#e(B

e$B%U%!%$%kL>$G0lHV=EMW$J$N$O!"%U%!%$%k$rF1Dj$G$-$k$H$$$&@-<A$Ge(B
e$B$O$J$$$G$7$g$&$+!#%U%!%$%kL>$rFI$a$k$H$$$&$N$O$=$N<!$K$/[email protected](B
e$B<[email protected]$H;W$$$^$9!#e(B

e$BNc$($P!":G6a!“F|K\8le(B (e$B$H>u67$+$i$O?dB,$5$l$ke(B)
e$B%U%!%$%kL>$,4^e(B
e$B$^$l$F$$$ke(B zip e$B%”!<%+%$%V$r07$&I,MW$,9g$C$?$N$G$9$,!"$3$l$re(B
e$B;d$,;H$C$F$$$ke(B Debian GNU/Linux e$B>e$Ge(B unzip
e$B$GE83+$9$k$H2u$le(B
e$B$F$$$k!"$"$k$$$O;d$NCN$i$J$$%3!<%I$J%U%!%$%kL>$,=P$FMh$^$7$?!#e(B

e$B$3$l$r07$$$?$$$H$9$k$H!“e(Bruby e$B$K4|BT$7$?$$$N$O!”$^$:e(B Dir#read
[email protected]$?e(B string e$B$re(B open e$B$de(B File.rename
e$B$KEO$7$?;~!"BP1~$9$k%U%!e(B
e$B%$%k$,=hM}$NBP>]$K$J$k$3$H$G$9!#e(B

e$B%U%!%$%kL>$NJQ49$r9T$C$F$7$^$&$H!"[email protected]<A$,I,$:$7$bJ]$?$l$Je(B
e$B$$$h$&$K;W$&$N$G$9$,!"$=$s$J$3$H$O$J$$$G$7$g$&$+e(B?

[email protected]$1!#e(B

In message [email protected]
on Thu, 5 Jun 2008 07:16:24 +0900,
“NARUSE, Yui” [email protected] wrote:

e$B$G$"$m$&0lJ}$Ge(B([email protected]$K$Oe(B/etc/sysconfig/i18ne$B$G;XDje(B)e$B!“e(B
Debiane$B$de(BBSDe$B$G$O%7%9%F%`A4BN$N%(%s%3!<%G%#%s%0$O$$=$i$/7hDj$G$-$^$;$s!#e(B
2e$B$D$NB&LL$,$”$j$^$9!#e(B

e$B$=$b$=$be(Blocalee$B$O%f!<%6$NA*Br!“F|K\8l4D6-!“1Q8l4D6-!”$=$NB>[email protected]$J$N$+e(B
e$B$K$h$C$FJQ$o$k$b$N$G$9!#$$$o$P!”@Z$jBX$($F;HMQ$5$l$k$3$H$,A0Ds$N$b$N$Ge(B
e$B$9!#$=$N0lJ}$G!“e(Blocalee$B$K=>$C$F!”%U%!%$%k%7%9%F%`$NJ8;z%(%s%3!<%G%#%s%0e(B
e$B$,[email protected]$($P!"$=$&$G$J$$>l9g$,KX$s$I$G$O$J$$$G$7$g$&$+!#e(B(e$B$=$&$$e(B
e$B$&$3$H$,$G$-$F$$$l$P!"B?>/$O9,$;$J>u67$K$J$k$N$+$b$7$l$^$;$s!#e(B)

e$B$^$?!“Aj<j$K$9$k%U%!%$%k%7%9%F%$be(Bffse$B$de(Bext?e$B$H$+$K8B$i$:!">u67$K$h$C$Fe(B e$B$Oe(BFATe$B$de(BNTFSe$B$H$$$C$?30MM$J%U%!%$%k%7%9%F%$r07$&>l9g$b$”$j$^$9!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:34934] Re: open() and encodings”
on Jun.05,2008 10:47:58, [email protected] wrote:

  • Win32e$B$G$Oe(Brb_filesystem_encoding()e$B$,e(Brb_locale_encoding()e$B$K$J$Ce(B
    e$B$F$^$9$,!"$=$l$O$=$l$G$$$$$s$G$9$+!)e(B

e$B8e$+$i>!<j$K8GDje(B(UTF-16orUTF-8)e$B$KJQ$($h$&$H;W$C$F8+$F$^$7$?!#e(B

  • e$B>e$K$b=q$$$?DL$j!“[email protected]<(E*$K;XDj$7$J$$8B$j%Q%9$N%(%s%3!<%G%#e(B
    e$B%s%0$OJQ49$7$F$[$7$/$”$j$^$;$s!#>/$J$/$H$be(BUNIXe$B7Oe(BOSe$B>e$G$O!#e(B
    e$B%Q%9$N%(%s%3!<%G%#%s%0$,e(BOSe$B$H$7$FDj5A$5$l$F$$$ke(BWindowse$B$de(BOSX
    e$B$G$O!“e(BRubye$B$,e(BUTF-16e$B$r07$$$K$/$$$N$G%G%U%)%k%H$Ge(BUTF-8 e$B$KJQ49e(B
    e$B$9$k$3$H$O%”%[email protected]$H;W$$$^$9!#e(B

UNIXe$B$G0EL[$NJQ49$r$7$J$$$N$O$$$$$H$7$F!“e(BWindowse$B$G$O0EL[$NJQ49e(B
e$B$r$7$A$c$C$F$b$$$$$G$7$g$&$+e(B?
Windowse$BHG%a%s%F%J$H$7$F$O$=$l$r4uK>$7$^$9!”$H$$$&$+!"e(BUTF-16e$B$Ke(B
e$BMn$H$5$J$$8B$j8F$Ve(BAPIe$B$rJ,$1$J$$$H$$$1$J$/$J$k$N$G%a%s%F$G$-$Je(B
e$B$$$H$$$&$+!#e(B

e$B$=$l$G$O!#e(B

¤Þ¤Ä¤â¤È ¤æ¤­¤Ò¤í¤Ç¤¹

In message “Re: [ruby-dev:34931] Re: open() and encodings”
on Thu, 5 Jun 2008 07:16:24 +0900, “NARUSE, Yui” [email protected]
writes:

|> ¡Ö¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¡×¤Ã¤ÆÊÑ´¹¤·¤ÆÅϤ»¤ë¤Û¤É
|> ¿®Íê¤Ç¤­¤ë¤â¤Î¤Ê¤ó¤Ç¤·¤ç¤¦¤«¡£ÊÑ´¹¤Ã¤Æ¤Î¤Ï´Ö°ã¤Ã¤Æ¤ë¤ÈÃ×̿Ū
|> ¤Ç¤¹¤«¤é¡£
|
|ÊÑ´¹¤Ç´Ö°ã¤¨¤ÆÆɤá¤Ê¤¤¤Î¤Ï¡¢¼ÂºÝ¤Ï¤½¤³¤Þ¤ÇÃ×̿Ū¤Ç¤Ï¤Ê¤¤¤È»×¤¦¤Î¤Ç¤¹¡£
|¤½¤Î¤è¤¦¤Ê¥±¡¼¥¹¤Ç¤Ï¤É¤Î¤ß¤Á¤É¤³¤«¤ÇÊÑ´¹¤·¤¿¤Ç¤¢¤í¤¦¤Ï¤º¤Ç¡¢
|¤³¤Î¾ì¹ç¤É¤³¤ÇÊÑ´¹¤·¤Æ¤âÃí°Õ¿¼¤¯¤·¤Ê¤¤¤ÈÆɤá¤Ê¤¤¤â¤Î¤ÏÆɤá¤Ê¤¤¤ï¤±¤Ç¤¹¡£
|¤Ê¤é¤Ð¡¢Æɤá¤ë¤â¤Î¤Ï³Ú¤ËÆɤ᤿Êý¤¬¤¤¤¤¤Ç¤¢¤í¤¦¤È¡£
|
|¤É¤Á¤é¤«¤È¤¤¤¨¤Ðµ¤¤Ë¤·¤Æ¤¤¤¿¤Î¤ÏÆɤá¤Æ¤Ï¤Ê¤é¤Ê¤¤¤â¤Î¤òÆɤá¤Æ¤·¤Þ¤¦¾ì¹ç¤Ç¤·¤¿¤¬¡¢
|¤³¤Á¤é¤â·ë¶ÉÊÑ´¹¤¬É¬Íפʾì¹ç¤Ë¤ª¤±¤ë¶¼°Ò¤ÏÁý¸º¤·¤Ê¤¤¤Ç¤¢¤í¤¦¤È¤¤¤¦¸«²ò¤Ç¤¹¡£

¤´¤á¤ó¤Ê¤µ¤¤¡¢¤ª¤Ã¤·¤ã¤ë¤³¤È¤¬¤è¤¯¤ï¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
À®À¥¤µ¤ó¤Î¤ª¤Ã¤·¤ã¤ë¡ÖÆɤá¤ë¡×¤È¤¤¤¦¤Î¤Ï¡¢¡Ö¿Í´Ö¤ËÆɤá¤ë¡×¤È
¤¤¤¦°ÕÌ£¤Ê¤ó¤Ç¤·¤ç¤¦¤«¡£¤½¤¦¤À¤È¤¹¤ë¤È»ä¤Ï¤½¤ì¤Ï¤µ¤Û¤É½Å»ë¤·
¤Æ¤¤¤Ê¤¯¤Æ¡¢¤à¤·¤í¡Ö²õ¤ì¤Æ¤¤¤Ê¤¤¡×¤³¤È¤ò½Å»ë¤·¤¿¤¤¤È¤³¤í¤Ç¤¹¡£

ÊÑ´¹¡¢Æä˰ÅÌÛ¤ÎÊÑ´¹¤¬Æþ¤ë¤È¡¢Ê¸»ú¤¬ÊѲ½¤¹¤ë(Àµµ¬²½¤ä¿ÂпÂÐ
±þ¤Ê¤É)²ÄǽÀ­¤¬¤¢¤ê(¤Þ¤¢¡¢¤³¤ÎÅÀ¤Ë¤Ä¤¤¤Æ²þ¤á¤ÆÀ®À¥¤µ¤ó¤Ë»ØŦ
¤¹¤ëɬÍפϤʤ¤¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¤¬)¡¢¤½¤Î¤è¤¦¤ÊÌäÂê¤ÎȯÀ¸¤ò½õĹ
¤·¤«¤Í¤Ê¤¤»ÅÍͤÎƳÆþ¤Ë¤Ï¤È¤¯¤Ë¿µ½Å¤Ç¤¢¤ë¤Ù¤­¤À¤È¹Í¤¨¤Þ¤¹¡£

|¤³¤Á¤é¤ÏUNIX¤Ë¤ª¤±¤ë¥Ç¥Õ¥©¥ë¥È¤¬locale¤Ç¤ÏŬÀڤȤϸÀ¤¨¤Ê¤¤¡¢
|¤È¤¤¤¦¤³¤È¤Ç¤·¤ç¤¦¤«¡£

¤½¤¦¤Ç¤¹¤Í¡£¤½¤ì¤Ë´ð¤Å¤¤¤Æ¥Õ¥¡¥¤¥ë̾¤Î°ÅÌÛ¤ÎÊÑ´¹¤¬¹Ô¤ï¤ì¤ë¤Î
¤Ç¤¢¤ì¤Ð¡¢´Ö°ã¤Ã¤Æ¤¤¤ë¤È±Æ¶Á¤¬Èó¾ï¤ËÂ礭¤¤¤Î¤Ç¤¹¤¬¡¢locale¤Ï
¤½¤³¤Þ¤Ç¿®Íê¤Ç¤­¤ë¾ðÊó¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¡£¤¿¤À¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¥¿¥°¤òÉÕ¤±¤ë¤À¤±¤Ç¤¢¤ì¤Ð¤½¤ì¤Û¤ÉÉÔŬÀڤȤϸÀ¤¨¤Ê¤¤¤Ç¤·¤ç¤¦¤¬¡£

|¤È¡¢¤¹¤ë¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Ï ASCII-8BIT ¤¢¤¿¤ê¤Ë¤·¤ÆÊÑ´¹¤·¤Ê¤¤Êý¤¬¤¤¤¤¤Î¤Ç¤¹¤«¤Í¤§¡£

¾¤Î¤È¤³¤í¤Ç¤âÅ°Ä줵¤ì¤Æ¤¤¤ë¡ÖÌÀ¼¨Åª¤Ë»ØÄꤷ¤Ê¤¤¸Â¤êÊÑ´¹¤·¤Ê
¤¤¡×¤È¤¤¤¦¥Ý¥ê¥·¡¼¤Ï°Ý»ý¤·¤¿¤¤¤È¤³¤í¤Ç¤¹¡£

|> ¤¨¡¼¤È¡¢IO.read¤Ê¤É¤ÎÎà¿ä¤«¤é¤¤¤¨¤Ð¡¢¤Þ¤º
|>
|> open(“filename”, encoding: “EUC-JP:Shift_JIS”)
|>
|> ¤ÎƳÆþ¤¬Àè¤À¤í¤¦¤È»×¤¤¤Þ¤¹¡£¤Ç¡¢internal_encoding¤Ê¤É¤ËÈ¿ÂÐ
|> ¤¹¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤½¤Î¾ì¹ç¤Ë¤Ïopen_key_args¤âƱ¤¸¥ª
|> ¥×¥·¥ç¥ó¤ò¼õ¤±ÉÕ¤±¤ë¤Ù¤­¤Ç¤·¤ç¤¦¤Í¡£
|
|¤Ê¤ë¤Û¤É¡£
|¤½¤Î¤è¤¦¤ËÊѹ¹¤·¤Æ¤ß¤Þ¤·¤¿¡£

¥Ñ¥Ã¥Á¤òÆɤó¤Ç¤ß¤Þ¤·¤¿¡£

  • Win32¤Ç¤Ïrb_filesystem_encoding()¤¬rb_locale_encoding()¤Ë¤Ê¤Ã
    ¤Æ¤Þ¤¹¤¬¡¢¤½¤ì¤Ï¤½¤ì¤Ç¤¤¤¤¤ó¤Ç¤¹¤«¡©

  • ¾å¤Ë¤â½ñ¤¤¤¿Ä̤ꡢÌÀ¼¨Åª¤Ë»ØÄꤷ¤Ê¤¤¸Â¤ê¥Ñ¥¹¤Î¥¨¥ó¥³¡¼¥Ç¥£
    ¥ó¥°¤ÏÊÑ´¹¤·¤Æ¤Û¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£¾¯¤Ê¤¯¤È¤âUNIX·ÏOS¾å¤Ç¤Ï¡£
    ¥Ñ¥¹¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬OS¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ëWindows¤äOSX
    ¤Ç¤Ï¡¢Ruby¤¬UTF-16¤ò°·¤¤¤Ë¤¯¤¤¤Î¤Ç¥Ç¥Õ¥©¥ë¥È¤ÇUTF-8 ¤ËÊÑ´¹
    ¤¹¤ë¤³¤È¤Ï¥¢¥ê¤À¤È»×¤¤¤Þ¤¹¡£

  • external_encoding, internal_encoding¤Ç¤¹¤¬¡¢²þ¤á¤Æ¹Í¤¨¤Æ¤ß
    ¤ë¤È¡¢¤³¤ì¤À¤È¸½¾õ¤Ç¤Ï¤Ç¤­¤Ê¤¤external_encoding¤ò»ØÄꤻ¤º¤Ë
    internal_encoding¤ò»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¤è¤Í¡£¸¡¾Ú¤·¤Æ¤¤¤Ê
    ¤¤¤ó¤Ç¤¹¤¬¡¢¤Û¤«¤Î¾ì½ê¤Ç¤½¤Î¤è¤¦¤ÊÁȤ߹ç¤ï¤»¤òÁÛÄꤷ¤Æ¤¤¤Ê
    ¤¤¤ó¤Ç¡¢¤Á¤ã¤ó¤ÈÆ°¤«¤Ê¤¤¤è¤¦¤Ê¡£¤¿¤Ö¤ó¡¢internal_encoding
    ¤À¤±¤¬»ØÄꤵ¤ì¤¿»þ¤Ë¤Ï¥¨¥é¡¼¤Ë¤Ê¤ë¤Ù¤­¤Ê¤ó¤À¤È»×¤¤¤Þ¤¹¡£¾¯
    ¤Ê¤¯¤È¤â¥Õ¥¡¥¤¥ë¤ÎÃæ¿È¤Ë´Ø¤·¤Æ¤Ï¡£

    ¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Ø¤·¤Æ¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬
    ·è¤Þ¤Ã¤Æ¤¤¤ëOS¤Ç¤ÏÌäÂꤢ¤ê¤Þ¤»¤ó¤¬¡¢·è¤Þ¤é¤Ê¤¤OS(UNIX·Ï)¤Ç
    ¤Ï¤ä¤Ï¤ê¥¨¥é¡¼¤Ë¤Ê¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¤«¤È¡£

      ¤Þ¤Ä¤â¤È ¤æ¤­¤Ò¤í /:|)

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34935] Re: open() and encodings”
on Thu, 5 Jun 2008 12:51:10 +0900, “U.Nakamura”
[email protected] writes:

|> * e$B>e$K$b=q$$$?DL$j!“[email protected]<(E*$K;XDj$7$J$$8B$j%Q%9$N%(%s%3!<%G%#e(B
|> e$B%s%0$OJQ49$7$F$[$7$/$”$j$^$;$s!#>/$J$/$H$be(BUNIXe$B7Oe(BOSe$B>e$G$O!#e(B
|> e$B%Q%9$N%(%s%3!<%G%#%s%0$,e(BOSe$B$H$7$FDj5A$5$l$F$$$ke(BWindowse$B$de(BOSX
|> e$B$G$O!“e(BRubye$B$,e(BUTF-16e$B$r07$$$K$/$$$N$G%G%U%)%k%H$Ge(BUTF-8 e$B$KJQ49e(B
|> e$B$9$k$3$H$O%”%[email protected]$H;W$$$^$9!#e(B
|
|UNIXe$B$G0EL[$NJQ49$r$7$J$$$N$O$$$$$H$7$F!"e(BWindowse$B$G$O0EL[$NJQ49e(B
|e$B$r$7$A$c$C$F$b$$$$$G$7$g$&$+e(B?

e$B$J$K$b;XDj$5$l$J$$>l9g$K!"%U%!%$%k%7%9%F%`$Ne(BUTF-16LEe$B$+$ie(B
UTF-8e$B$X!"$H$$$&$3$H$G$9$h$M!#$=$l$O9=$o$J$$$H;W$$$^$9!#8GDjJQe(B
e$B49$G$9$+$i>pJs$,Mn$A$k?4G[$O$"$j$^$;$s$7!#e(B

Dire$B$X$N0z?t$G30It%(%s%3!<%G%#%s%0$,[email protected]<(E*$K;XDj$5$l$?>l9g$K$Ie(B
e$B$&$9$k$N$+$H$$$&$N$O$h$/$o$+$i$J$$$G$9$1$I$M!#30ItE*$K$Oe(B
Unicodee$B$J$N$O7h$^$C$F$k$o$1$G$9$+$i!“e(BUnicodee$B0J30$,;XDj$5$l$?e(B
e$B$i%(%i!<$C$F$3$H$J$N$+$J$”!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34937] Re: open() and encodings”
on Thu, 5 Jun 2008 13:31:39 +0900, “U.Nakamura”
[email protected] writes:

|e$B$"$l!"$3$3$G$Oe(Bopene$B$NOC$G$9$h$M!#e(B

e$B$=$&$J$s$G$9$+!#e(BDire$B$NOC$r$7$F$^$7$?!#e(B

|e$B$G$9$+$i!";d$,0U?^$7$?$N$O!“e(B
| e$B0z?t$H$7$FM?$($i$l$?%U%!%$%kL>$r!”$=$N%(%s%3!<%G%#%s%0$,2?e(B
| e$B$G$"$k$+$K4X$o$i$:!“e(B(e$B%7%9%F%8GDj$N%U%!%$%k%7%9%F%%(%s%3!<e(B
| e$B%G%#%s%0$G$”$ke(B)UTF-16LEe$B$X0EL[$NJQ49$r9T$C$?>e$Ge(BOSe$B$Ne(BAPIe$B8F$Se(B
| e$B=P$7$r9T$&e(B
|e$B$G$9!#e(B

[email protected]$H$9$k$H!“e(BOSe$B$N%Q%9%(%s%3!<%G%#%s%0$,8GDj$G$”$k$N$J$i$Pe(B
UTF-16LEe$B$X$NJQ49$O%"%[email protected]$H;W$$$^$9!#e(BUNIXe$B7O$G$O8GDj$G$J$$$N$Ge(B
e$BJQ49$O%J%7!#e(BOSXe$B$K$D$$$F$O$o$+$j$^$;$s!#e(B

|Dir.entriese$BEy$G<h$C$F$-$?$b$N$r$I$&$9$k$+$O$^$?JLLdBj$H$$$&$3e(B
|e$B$H$G!#e(B

e$B$H$3$m$G!“e(BAPIe$B$H$+$r;H$C$F2u$l$?e(BUTF-16e$BJ8;zNs$r%Q%9$K$G$-$?$j$Ge(B
e$B$-$k$s$G$9$+$M$(!#$=$&[email protected]$H$9$k$He(BDire$B$+$i$NJ8;zNs$rJQ49$9$k$Ne(B
e$B$O$^$:$$%1!<%9$,$”$j$($^$9$M$(!#2u$l$F$$$k$+$i07$($J$/$F$b$$e(B
e$B$$$H$O$$$+$J$$$G$7$g$&$7!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:34936] Re: open() and encodings”
on Jun.05,2008 13:09:20, [email protected] wrote:

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34935] Re: open() and encodings”
on Thu, 5 Jun 2008 12:51:10 +0900, “U.Nakamura” [email protected] writes:
|UNIXe$B$G0EL[$NJQ49$r$7$J$$$N$O$$$$$H$7$F!"e(BWindowse$B$G$O0EL[$NJQ49e(B
|e$B$r$7$A$c$C$F$b$$$$$G$7$g$&$+e(B?

e$B$J$K$b;XDj$5$l$J$$>l9g$K!"%U%!%$%k%7%9%F%`$Ne(BUTF-16LEe$B$+$ie(B
UTF-8e$B$X!"$H$$$&$3$H$G$9$h$M!#$=$l$O9=$o$J$$$H;W$$$^$9!#8GDjJQe(B
e$B49$G$9$+$i>pJs$,Mn$A$k?4G[$O$"$j$^$;$s$7!#e(B

e$B$"$l!"$3$3$G$Oe(Bopene$B$NOC$G$9$h$M!#e(B
e$B$G$9$+$i!";d$,0U?^$7$?$N$O!“e(B
e$B0z?t$H$7$FM?$($i$l$?%U%!%$%kL>$r!”$=$N%(%s%3!<%G%#%s%0$,2?e(B
e$B$G$"$k$+$K4X$o$i$:!“e(B(e$B%7%9%F%8GDj$N%U%!%$%k%7%9%F%%(%s%3!<e(B
e$B%G%#%s%0$G$”$ke(B)UTF-16LEe$B$X0EL[$NJQ49$r9T$C$?>e$Ge(BOSe$B$Ne(BAPIe$B8F$Se(B
e$B=P$7$r9T$&e(B
e$B$G$9!#e(B

Dir.entriese$BEy$G<h$C$F$-$?$b$N$r$I$&$9$k$+$O$^$?JLLdBj$H$$$&$3e(B
e$B$H$G!#e(B

[email protected]$O$7$?$o$1$G$9$,!"$^[email protected]$$$m$$$mG<[email protected]$G$-$F$$$^e(B

e$B$;$s!#e(B

Dire$B$X$N0z?t$G30It%(%s%3!<%G%#%s%0$,[email protected]<(E*$K;XDj$5$l$?>l9g$K$Ie(B
e$B$&$9$k$N$+$H$$$&$N$O$h$/$o$+$i$J$$$G$9$1$I$M!#30ItE*$K$Oe(B
Unicodee$B$J$N$O7h$^$C$F$k$o$1$G$9$+$i!“e(BUnicodee$B0J30$,;XDj$5$l$?e(B
e$B$i%(%i!<$C$F$3$H$J$N$+$J$”!#e(B

e$B$?$V$s%(%i!<[email protected]$m$&$H;W$$$^$9!#e(B

e$B$=$l$G$O!#e(B

e$B$3$s$K$A$O!#?y1:$G$9!#e(B

In Message “[ruby-dev:34945] Re: open() and encodings”
[email protected],
Kazuhiro NISHIYAMA [email protected] said;
e$B3N$+$K!"e(BRedHate$B7O$G$9$H;vee(BUTF-8e$B$,%U%!%$%k%7%9%F%$N%(%s%3!<%G%#%s%[email protected]$($ke(B e$B$G$"$m$&0lJ}$Ge(B([email protected]$K$Oe(B/etc/sysconfig/i18ne$B$G;XDje(B)e$B!"e(B Debiane$B$de(B*BSDe$B$G$O%7%9%F%A4BN$N%(%s%3!<%G%#%s%0$O$*$=$i$/7hDj$G$-$^$;$s!#e(B

e$B:[email protected]$He(BDebiane$B7O$G$be(BRedhate$B7O$N$h$&$Ke(B/etc/default/localee$B$H$$$&$N$,$"$j$^$9!#e(B
sargee$B0JA0$+$ie([email protected]$He(B/etc/default/localee$B$,$J$/$Fe(B
/etc/environmente$B$NJ}$K$7$+e(Blocalee$B4X78$N5-=R$,$J$$$+$b$7$l$^$;$s$,!"e(B
/etc/pam.de$B$NCf$Ge(B/etc/default/localee$B$r;2>H$7$F$$$^$9!#e(B

e$B3N$+$K%7%9%F%%0%m!<%P%k$Je(B locale [email protected]_Dj$,F~$k$h$&$K$J$j$^$7$?$,!"$=$l$Oe(B e$BC1$K%G%#%U%)%k%H$H$$$&[email protected]$1$8$c$J$$$G$7$g$&$+!#%f!<%6$,>e=q$-$9$k;v$Oe(B e$BB?$$$G$7$g$&$7!J%7%9%F%$O1Q8l$G!"%f!<%6$OF|K\8l$H$+!K!"e(Blocale
e$B$Ne(B
e$B%(%s%3!<%G%#%s%0$OI,$:$7$b%U%!%$%kL>$N%(%s%3!<%G%#%s%0$HF1$8$G$O$J$$e(B
e$B$H$*$b$$$^$9!#e(B

e$B$?$H$($Pe(B gnome ([email protected]$&$+e(B glib) e$B$Oe(B locale
e$B$KL54X78$K%U%!%$%kL>$Oe(B
e$BA4Ite(B UTF-8 e$BA0Ds$GF0$$$F$$$kMM$G$9!#e(BUTF-8
[email protected]$J$b$N$Oe(B locale e$B$Ne(B
e$B%(%s%3!<%G%#%s%0$r;[email protected]$7$/I=<($7$F$/$l$^$9$,!"e(Bnautilus
e$B$G0lC6e(B
e$B%j%M!<%`$9$k$He(B(e$B4pK\E*$Ke(B)e$B>!<j$Ke(B UTF-8
e$B$KB7$($F$7$^$$$^$9!#e(B

http://www.gnome.gr.jp/docs/glib-2.8.x-refs/glib/glib-Character-Set-Conversion.html

e$B8D?ME*$K$O$3$3$Oe(B ruby e$BK\BN$G<jEv$9$kNN0h$G$O$J$$$H46$8$^$9!#e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: “NARUSE, Yui” [email protected]
Subject: [ruby-dev:34931] Re: open() and encodings
Date: Thu, 5 Jun 2008 07:16:24 +0900
Message-ID: [email protected]

e$B$3$A$i$b7k6IJQ49$,I,MW$J>l9g$K$*$1$k6<0R$OA}8:$7$J$$$G$"$m$&$H$$$&8+2r$G$9!#e(B
[email protected]!$!V5_:Q$G$-$=$&$J$b$N$O5_:Q$7$F$"$2$?$$!W$H<gD%$7$?$ie(B
e$B!V?dB,[email protected]$+$i%@%a!%$-$A$s$H;XDj$9$k$h$&$Ke(B
e$B%3!<%[email protected]$5$;$k$Y$-!W$H5Q2<$5$l$?$h$&$J5-21$,!%!%!%e(B(^_^;

e$B!V$J$i$P!“FI$a$k$b$N$O3Z$KFI$a$?J}$,$$$$$G$”$m$&$H!#!W$C$F!$e(B
e$B!V5_:Q$G$-$=$&$J$b$N$O5_:Q$7$F$"$2$?$$!W$HF1N`$NH/A[$G$O$J$$$G$7$g$&$+!)e(B
[email protected]$($P!$;d$N;~$h$j$b$5$i$K!X0-!Y$N$h$&$K;W$($^$9!%e(B

e$BJL$K:,$K;}[email protected]$C$F$$$k$o$1$G$O$J$$$N$G!$8m2r$5$l$^$;$L$h$&!%e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

[email protected]$N$3$H$b$"$C$FI]$$$N$G$"$^$j4X$o$j$?$/$O$J$$$N$G$9$,!%e(B(^_^)

From: “U.Nakamura” [email protected]
Subject: [ruby-dev:34937] Re: open() and encodings
Date: Thu, 5 Jun 2008 13:31:39 +0900
Message-ID: [email protected]

e$B$G$"$k$+$K4X$o$i$:!“e(B(e$B%7%9%F%8GDj$N%U%!%$%k%7%9%F%%(%s%3!<e(B
e$B%G%#%s%0$G$”$ke(B)UTF-16LEe$B$X0EL[$NJQ49$r9T$C$?>e$Ge(BOSe$B$Ne(BAPIe$B8F$Se(B
e$B=P$7$r9T$&e(B
e$B$G$9!#e(B

Dir.entriese$BEy$G<h$C$F$-$?$b$N$r$I$&$9$k$+$O$^$?JLLdBj$H$$$&$3e(B
e$B$H$G!#e(B

[email protected]$O$7$?$o$1$G$9$,!"$^[email protected]$$$m$$$mG<[email protected]$G$-$F$$$^e(B

e$B$;$s!#e(B

e$BEDCf$5$s$,e(B [ruby-dev:34933] e$B$G;XE&$5$l$?$h$&$K!$e(B
e$B%U%!%$%kL>$,2u$l$F$$$ke(B or e$B8=4D6-$H$O9g$o$J$$$H$$$&%1!<%9$Oe(B
e$BI,$:$"$k$H;W$$$^$9!%e(B
e$B0EL[$NJQ49$O4m812a$.$^$;$s$+!%e(B

e$B!Ve(BDir.entriese$BEy$G<h$C$F$-$?$b$N$r$I$&$9$k$+$OJLLdBj!W$H$5$l$F$^$9$,!$e(B
e$B<h$C$F$-$?L>A0$KBP$7$FM-L5$r%A%’%C%/$9$k$J$I$7$Fe(B
e$B%U%!%$%kA`:n$J$j$N=hM}$r9T$*$&$H$9$k$He(B
e$BJQ49$,M=4|$;$L1F6A$r5Z$$962$l$,$"$k$N$G$O$J$$$G$7$g$&$+!%e(B
e$B>/$J$/$H$b!VJLLdBj!W$J$I$H$;$:$KA4BN$rPmbW$7$?>e$Ge(B
e$B07$$$r9M$($M$P$J$i$J$$$h$&$K;W$($^$9!%e(B

[email protected]>;3OB9-$G$9!#e(B

At Thu, 5 Jun 2008 07:16:24 +0900,
NARUSE, Yui wrote:

e$B3N$+$K!"e(BRedHate$B7O$G$9$H;vee(BUTF-8e$B$,%U%!%$%k%7%9%F%$N%(%s%3!<%G%#%s%[email protected]$($ke(B e$B$G$"$m$&0lJ}$Ge(B([email protected]$K$Oe(B/etc/sysconfig/i18ne$B$G;XDje(B)e$B!"e(B Debiane$B$de(B*BSDe$B$G$O%7%9%F%A4BN$N%(%s%3!<%G%#%s%0$O$*$=$i$/7hDj$G$-$^$;$s!#e(B

e$B:[email protected]$He(BDebiane$B7O$G$be(BRedhate$B7O$N$h$&$Ke(B/etc/default/localee$B$H$$$&$N$,$"$j$^$9!#e(B
sargee$B0JA0$+$ie([email protected]$He(B/etc/default/localee$B$,$J$/$Fe(B
/etc/environmente$B$NJ}$K$7$+e(Blocalee$B4X78$N5-=R$,$J$$$+$b$7$l$^$;$s$,!"e(B
/etc/pam.de$B$NCf$Ge(B/etc/default/localee$B$r;2>H$7$F$$$^$9!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:34949] Re: open() and encodings”
on Jun.05,2008 19:34:17, [email protected] wrote:

[email protected]$N$3$H$b$"$C$FI]$$$N$G$"$^$j4X$o$j$?$/$O$J$$$N$G$9$,!%e(B(^_^)

e$B$D!<$+;d$bI]$$$s$G$9$,$3$NJU$O!#e(B

Dir.entriese$BEy$G<h$C$F$-$?$b$N$r$I$&$9$k$+$O$^$?JLLdBj$H$$$&$3e(B
e$B$H$G!#e(B

[email protected]$O$7$?$o$1$G$9$,!"$^[email protected]$$$m$$$mG<[email protected]$G$-$F$$$^e(B

e$B$;$s!#e(B

e$BEDCf$5$s$,e(B [ruby-dev:34933] e$B$G;XE&$5$l$?$h$&$K!$e(B
e$B%U%!%$%kL>$,2u$l$F$$$ke(B or e$B8=4D6-$H$O9g$o$J$$$H$$$&%1!<%9$Oe(B
e$BI,$:$"$k$H;W$$$^$9!%e(B
e$B0EL[$NJQ49$O4m812a$.$^$;$s$+!%e(B

e$B;d$O4pK\E*$K$Oe(BWindowse$B$N$3$H$7$+9M$($F$J$$$N$G$=$l$,A0Ds$J$s$Ge(B
e$B$9$,!"e(BWindowse$B$G$O!“e(B
*
e$B%U%!%$%k%7%9%F%`$N%(%s%3!<%G%#%s%0$Oe(BUnicode(UTF-16LE)e$B8GDje(B
(e$B87L)$K$O$=$&$G$J$$>l9g$b$”$k$,9MN8$+$i>J$/e(B)

  • APIe$B$+$i$O%7%9%F%`%3!<%I%Z!<%8$"$k$$$O$N$$$:$l$+$G%U%!%$%ke(B
    e$B%(%s%H%j$r;XDj$G$-$ke(B
  • OSe$B$O%7%9%F%`%3!<%I%Z!<%8$G%U%!%$%k%(%s%H%j$,;XDj$5$l$?>le(B
    e$B9g$OFbItE*$Ke(BUnicodee$B$KJQ49$7$?>e$G%U%!%$%k%"%/%;%9$r9T$&e(B

e$B%7%9%F%`%3!<%I%Z!<%8$+$ie(BUnicodee$B$X$NJQ497k2L$O0l0U$KDj$^$ke(B
e$B$H$$$&FCD’$,$"$j$^$9!#e(B
e$B$h$C$F!"%U%!%$%kL>$,2u$l$F$$$J$$>l9g$O0EL[$NJQ49$r9T$C$F$bLde(B
e$BBj$O$"$j$^$;$s!#e(B

e$B$G!";XDj$5$l$?%U%!%$%kL>$,2u$l$F$$$k>l9g$G$9$,!"$=$N>l9g!“e(B
*
e$B0EL[$NJQ49$r<BAu$7$?>l9g!“2u$l$?%U%!%$%kL>$re(BUnicodee$B0J30$Ge(B
e$B;XDj$7$?$J$i$P!”$=$N0EL[$NJQ49$,<:GT$9$k$+L58z$J7k2L$H$Je(B
e$B$j!”$$$:$l$K$;$h%U%!%$%k$K$O%"%/%;%9$G$-$J$$e(B

  • e$B0EL[$NJQ49$r<BAu$7$J$+$C$?>l9g!“2u$l$?%U%!%$%kL>$r%7%9%Fe(B
    e$B%`%3!<%I%Z!<%8$G;XDj$7$?>l9g$Oe(BOSe$BFbIt$G$NJQ49$,<:GT$9$k$+e(B
    e$BL58z$J7k2L$H$J$j!”$$$:$l$K$;$h%U%!%$%k$K$O%"%/%;%9$G$-$Je(B
    e$B$$e(B
  • e$B2u$l$?%U%!%$%kL>$re(BUTF-16LEe$B$H$7$F8F$S=P$7$?>l9g!“0EL[$NJQe(B
    e$B49$,<BAu$5$l$F$$$F$b$$$J$/$F$b$=$N$^$^e(BOSe$B$KEO$5$l!”$=$N$he(B
    e$B$&$J%U%!%$%k%(%s%H%j$,$"$l$P$=$N$^$^%"%/%;%9$G$-$ke(B
    e$B$H$J$j$^$9!#e(B
    e$B$D$^$j!"0EL[$NJQ49$r<BAu$9$k$+$I$&$+$O2u$l$?%U%!%$%kL>$r;XDje(B
    e$B$7$?>l9g$NF0:n$K0c$$$r$b$?$i$7$^$;$s!#e(B

e$B!Ve(BDir.entriese$BEy$G<h$C$F$-$?$b$N$r$I$&$9$k$+$OJLLdBj!W$H$5$l$F$^$9$,!$e(B
e$B<h$C$F$-$?L>A0$KBP$7$FM-L5$r%A%’%C%/$9$k$J$I$7$Fe(B
e$B%U%!%$%kA`:n$J$j$N=hM}$r9T$*$&$H$9$k$He(B
e$BJQ49$,M=4|$;$L1F6A$r5Z$$962$l$,$"$k$N$G$O$J$$$G$7$g$&$+!%e(B

e$B$H$$$&$o$1$G!"$=$b$=$b2u$l$?%U%!%$%kL>$,%(%s%H%j$K3JG<$5$l$Fe(B
e$B$$$k>l9g$G$9$,!“e(B
*
e$B0EL[$NJQ49$r<BAu$7$?>l9g!“2u$l$?%U%!%$%kL>$re(BUnicodee$B0J30$Ge(B
e$B<h$C$F$3$h$&$H$7$?$J$i$P!”$=$N0EL[$NJQ49$,<:GT$9$k$+L58ze(B
e$B$J7k2L$K$J$j!”$$$:$l$K$;[email protected]$7$$%U%!%$%kL>[email protected]$i$l$J$$e(B

  • e$B0EL[$NJQ49$r<BAu$7$J$+$C$?>l9g!"2u$l$?%U%!%$%kL>$r%7%9%Fe(B
    e$B%`%3!<%I%Z!<%8$G<h$C$F$3$h$&$H$7$?$J$i$P!“e(BOSe$BFbIt$G$NJQ49e(B
    e$B$,<:GT$9$k$+L58z$J7k2L$H$J$j!”$$$:$l$K$;[email protected]$7$$%U%!%$%ke(B
    e$BL>[email protected]$i$l$J$$e(B
  • UTF-16LEe$B$G<[email protected]$7$h$&$H$7$?>l9g!“0EL[$NJQ49$,<BAu$5$l$F$$e(B
    e$B$F$b$$$J$/$F$b$=$N$^$^e(BOSe$B$+$i%U%!%$%kL>$,<[email protected]$G$-$ke(B
    e$B$H$J$j$^$9!#e(B
    e$B$H$$$&$o$1$G!”$d$O$j0EL[$NJQ49$r<BAu$9$k$+$I$&$+$O2u$l$?%U%!e(B
    e$B%$%kL>$N<[email protected]$K0c$$$r$b$?$i$7$^$;$s!#e(B

e$B>/$J$/$H$b!VJLLdBj!W$J$I$H$;$:$KA4BN$rPmbW$7$?>e$Ge(B
e$B07$$$r9M$($M$P$J$i$J$$$h$&$K;W$($^$9!%e(B

e$B9M$($F$_$^$7$?$,!"$I$&$G$9$+!#e(B

e$B$=$l$G$O!#e(B

[email protected]@%$G$9!#e(B

U.Nakamura wrote:

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:34934] Re: open() and encodings”
on Jun.05,2008 10:47:58, [email protected] wrote:

  • Win32e$B$G$Oe(Brb_filesystem_encoding()e$B$,e(Brb_locale_encoding()e$B$K$J$Ce(B
    e$B$F$^$9$,!"$=$l$O$=$l$G$$$$$s$G$9$+!)e(B

e$B8e$+$i>!<j$K8GDje(B(UTF-16orUTF-8)e$B$KJQ$($h$&$H;W$C$F8+$F$^$7$?!#e(B

e$B:#$Ne(B Ruby1.9 e$B$C$F$^[email protected](B Windows e$B$G$Oe(B ANSI API
e$B$G$9$h$M!)e(B
e$B$^$!!"e(BUnicode e$B$r;H$C$F$$$?$ie(B or e$B;H$&$h$&$K$J$C$?$i!"e(B
e$BJQ$($F$b$i$*$&$H;W$C$F$$$^$7$?!#e(B

[email protected]@%$G$9!#e(B

Tanaka A. wrote:

e$B<[email protected]$H;W$$$^$9!#e(B
e$B!VFI$a$k!W$,8m2r$r>7$/[email protected]$C$?$h$&$G?=$7Lu$J$$!#e(B
e$B<q;]$H$7$F$O!VF1Dj$G$-$k!W$G$-$ke(B
(e$B$=$3$+$i%"%/%;%92DG="*FI$a$k$HHtLve(B)
e$B$H$$$&<q;]$G$7$?!#e(B

e$B$$$h$&$K;W$&$N$G$9$,!"$=$s$J$3$H$O$J$$$G$7$g$&$+e(B?
e$BJQ49$r9T$($PJ][email protected]$,$"$j$^$9!#e(B

e$B$=$N$?$a!"$3$N>l9g$G$O!"e(BDir.open e$B$9$k:]$Ke(B ASCII-8BIT
e$B$G%Q%9$rJV$5$;!“e(B
open e$B$de(B rename e$B$K$be(B ASCII-8BIT
e$B$G%Q%9$rEO$9I,MW$,$”$k$G$7$g$&!#e(B

e$BA0Ds$H$7$F!"e(BDir.open e$B$Oe(B e$B%G%U%)%k%H$G$OJQ49$r9T$&$,!"e(B

ASCII-8BIT e$B$GJV$5$;$k<jCJ$,$"$k!#e(B

e$B$^$?!"e(Bopen e$B$de(B rename e$B$,e(B ASCII-8BIT

e$B$G%Q%9$r<u$1<h$C$?>l9g$OL5JQ49!#e(B

[email protected]@%$G$9!#e(B

Yukihiro M. wrote:

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34937] Re: open() and encodings”
on Thu, 5 Jun 2008 13:31:39 +0900, “U.Nakamura” [email protected] writes:

|e$B$"$l!"$3$3$G$Oe(Bopene$B$NOC$G$9$h$M!#e(B

e$B$=$&$J$s$G$9$+!#e(BDire$B$NOC$r$7$F$^$7$?!#e(B

e$B$G$9$M!“e(BDir e$B$NOC$b$7$?$$$N$G$9$,!”$H$j$"$($::#$Oe(B open
e$B$N0z?t$N%Q%9$K$D$$$F$G!#e(B

|e$B$G$9$+$i!";d$,0U?^$7$?$N$O!“e(B
| e$B0z?t$H$7$FM?$($i$l$?%U%!%$%kL>$r!”$=$N%(%s%3!<%G%#%s%0$,2?e(B
| e$B$G$"$k$+$K4X$o$i$:!“e(B(e$B%7%9%F%8GDj$N%U%!%$%k%7%9%F%%(%s%3!<e(B
| e$B%G%#%s%0$G$”$ke(B)UTF-16LEe$B$X0EL[$NJQ49$r9T$C$?>e$Ge(BOSe$B$Ne(BAPIe$B8F$Se(B
| e$B=P$7$r9T$&e(B
|e$B$G$9!#e(B

[email protected]$H$9$k$H!“e(BOSe$B$N%Q%9%(%s%3!<%G%#%s%0$,8GDj$G$”$k$N$J$i$Pe(B
UTF-16LEe$B$X$NJQ49$O%"%[email protected]$H;W$$$^$9!#e(BUNIXe$B7O$G$O8GDj$G$J$$$N$Ge(B
e$BJQ49$O%J%7!#e(BOSXe$B$K$D$$$F$O$o$+$j$^$;$s!#e(B

e$B$o$+$j$^$7$?!“e(BUnixe$B$K4X$7$F$O>u67$,JQ$o$k$^$GL5JQ49$NJ}8~$G!#e(B
Mac OS X e$B$Oe(B UTF8-MAC
e$B$G$9$+$iB?J,$”$C$?$[$&$,$$$$$H;W$&$N$G$9$,!"e(B
e$B<B:]$K;H$C$F$$$k?M$N0U8+$bM_$7$$=j!#e(B
e$B$I$J$?$+$$$i$C$7$c$$$^$;$s$+$M!#e(B

In message [email protected]
on Thu, 5 Jun 2008 23:35:23 +0900,
“NARUSE, Yui” [email protected] wrote:

Mac OS X e$B$Oe(B UTF8-MAC e$B$G$9$+$iB?J,$"$C$?$[$&$,$$$$$H;W$&$N$G$9$,!"e(B
Bootcampe$B$G:n$C$?e(BWindowse$B$Ne(BFAT32e$B$J%Q!<%F%#%7%g%s!"e(BUSBe$B%a%b%j$rA^$7$?e(BFAT32
e$B$J%U%!%$%k%7%9%F%`$b$=$&$J$s$G$7$g$&$+e(B?

e$B<B:]$K;H$C$F$$$k?M$N0U8+$bM_$7$$=j!#e(B
e$B$I$J$?$+$$$i$C$7$c$$$^$;$s$+$M!#e(B
e$B;~4V$,$"$C$?$i2q<R$G;n$7$F$_$^$7$g$&!"$C$F2?$r$I$&%A%’%C%/$9$l$PNI$$$se(B
e$B$+$Je(B?

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: “U.Nakamura” [email protected]
Subject: [ruby-dev:34951] Re: open() and encodings
Date: Thu, 5 Jun 2008 20:27:17 +0900
Message-ID: [email protected]

e$B;d$O4pK\E*$K$Oe(BWindowse$B$N$3$H$7$+9M$($F$J$$$N$G$=$l$,A0Ds$J$s$Ge(B
e$B$9$,!"e(BWindowse$B$G$O!“e(B
(snip)
e$B9M$($F$_$^$7$?$,!”$I$&$G$9$+!#e(B

e$B$^$k$C$-$jJ,$+$C$F$$$J$$$N$G!$e(B
e$B!V$=$&$$$&$b$N$J$N$+$J!)[email protected]$($^$;$s!%e(B(^_^;
[email protected][email protected]$1$G$9$,!$e(B
[email protected]<A$Oe(B SAMBA
e$B$J$I$G%U%!%$%k%7%9%F%`$NDs6!$r<u$1$F$$$k>l9g$be(B
e$B3N<[email protected]$jN)$D$N$G$7$g$&$+!)e(B