Encoding.default_internal $B$N$?$a$N%Q%C%A(B

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

In message “Re: [ruby-dev:36542] Re: Encoding.default_internal
¤Î¤¿¤á¤Î¥Ñ¥Ã¥Á”
on Thu, 25 Sep 2008 10:16:58 +0900, Martin D.
[email protected] writes:

|>¤¹¤Ù¤Æ¤¬ UTF-8 ¤Ê¤é¤Ð¸À¤¦¤Þ¤Ç¤âÌäÂꤢ¤ê¤Þ¤»¤ó¡£
|>¤·¤«¤·¡¢ÆþÎϸµ¡¦½ÐÎÏÀ衦¥¹¥¯¥ê¥×¥È¤Î¥ê¥Æ¥é¥ë¤¬Á´¤ÆÎ㤨¤Ð CP932 ¤Î¾ì¹ç¡¢
|>Ruby 1.9 ¤Ç¤ÏÆþÎϤȥê¥Æ¥é¥ë¤ò·ë¹ç¤Ç¤­¤Þ¤»¤ó¡£
|
|¤³¤ì¤Ïº¬ËÜŪ¤ÊÌäÂê¤Ê¤Î¤«¡¢¡Ö-L ¤ò»ØÄꤷ¤Ê¤¤¸Â¤ê¡×¤Ê¤Î¤«?
|¸å¼Ô¤À¤È»×¤¤¤Þ¤¹¤¬¡¢À®À¥¤µ¤ó¡¢³Îǧ¤Ç¤­¤Þ¤¹¤«¡£

¡Ö-L ¤ò»ØÄꤷ¤Ê¤¤¸Â¤ê¡×¤Ç¤·¤ç¤¦¤Í¡£

|>¿ô¹Ô¤Î½ñ¤­¼Î¤Æ¥¹¥¯¥ê¥×¥È¤Ç¤¤¤Á¤¤¤Á -L »ØÄꤷ¤Ê¤¤¤È¤¤¤±¤Ê¤¤¤È¤«¡¢
|>¿ô¹Ô¤ËÂФ·¤Æ¤Î " -L" ¤Ê¤Î¤Ç¡¢¤Þ¤¡¤½¤ì¤Ê¤ê¤Ë¥¤¥ó¥Ñ¥¯¥È¤Ï¡£
|
|¤½¤¦¤Ç¤¹¤Í¡£¤â¤¦°ì¤Ä¤Á¤ç¤Ã¤È¿´ÇÛ¤Ê¤Î¤Ï 1.8 ¤È¤Î¸ß´¹À­¤Ç¤¹¡£
|-L ¤ÎƳÆþ¤Ç¤½¤Î -L ¤òÉÕ¤±¤ë¤«¤É¤¦¤«¤Ê¤É¤Îºî¶È¤¬È¯À¸¤·¤Þ¤¹¡£
|
|>°ìÊý¤Î Unicode ¤Ï´ðËÜŪ¤ËµðÂç¤Ê²ÀÍõ¤òÃÛ¤¯ºÝ¤Ë¿¿²Á¤òȯ´ø¤¹¤ë¤ï¤±¤Ç¡¢
|>¤´¤Æ¤´¤Æ¤È¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤µ¤»¤ë¤Î¤ÏǺ¤ß¿¤­ Unicoder ¤Ë¤ÏÈÑ»¨¤Ç¤·¤ç¤¦¤¬¡¢
|>-U ¥ª¥×¥·¥ç¥ó°ì¤Ä¤Ê¤é¤ÐÌäÂê¤Ê¤¤¤ó¤¸¤ã¤Ê¤¤¤«¤¢¤¡¡£
|
|¤½¤¦¤Ç¤¹¤Í¡£

|¤³¤³¤Ï¤Á¤ç¤Ã¤È¿´ÇۤΤȤ³¤í¤Ç¤¹¡£Æä˳°¹ñ¤Î¥×¥í¥°¥é¥Þ¤Ï
|¡ÖÁ´Éô UTF-8 ¤Ç¤ä¤Ã¤Æ¤·¤Þ¤¦¡×Æ°¸þ¤¬¶¯¤¤¤Ç¤·¤ç¤¦¡£
|¤½¤ì¤Ç¤¤¤¤¤È¤¤¤¦²ÄǽÀ­¤â¤¢¤ê¤Þ¤¹¤¬¡¢¤½¤¦¤Ç¤Ï¤Ê¤¤²ÄǽÀ­¤â
|¤¢¤ê¤Þ¤¹¡£

¡Ö¤½¤ì¤Ç¤Ï¤è¤¯¤Ê¤¤¡×¾ì¹ç¤Ë¤Ï¡¢¤É¤¦¤·¤ÆÎɤ¯¤Ê¤¤¤Î¤«ÀâÌÀ¤·¤ÆÂÐ
±þ¤·¤Æ¤â¤é¤¦¤·¤«¤Ê¤¤¤Ç¤·¤ç¤¦¤Í¡£

|>default_internal ¤¬¶õ¤Î¾ì¹ç¤Ï default_external ¤ÇÊÖ¤¹¤Î¤Ç¤¹¤«¤Í¡£
|
|¥Ñ¥Ã¥Á¤òºî¤Ã¤¿¤È¤­¤Ë¡¢¡Ödefault_internal ¤¬¶õ¤Ê¤é default_external¡×
|¤òÊÖ¤¹µ¡Ç½¤ÎɬÍ×À­¤ò´¶¤¸»Ï¤á¤Þ¤·¤¿¡£

[ruby-dev:36551]¤Ë¤â½ñ¤¤¤¿¤è¤¦¤Ë¤½¤¦¤¹¤ë¤Ù¤­¤À¤È(º£¤Ï)»×¤Ã¤Æ
¤¤¤Þ¤¹¡£

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

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

In message “Re: [ruby-dev:36550] Re: Encoding.default_internal
e$B$N$?$a$N%Q%C%Ae(B”
on Thu, 25 Sep 2008 14:30:53 +0900, Nobuyoshi N.
[email protected] writes:

|> * default_internale$B$Oe(BIOe$B$Ge(Binternale$B$r;XDj$7$J$+$C$?>l9g$N%(%s%3!<e(B
|> e$B%G%#%s%0$G$"$ke(B
|> * e$B$3$l$,;XDj$5$l$F$$$k;~e(BIOe$B$+$i$NF~NO$Oe(B(e$B%P%$%J%j$G$J$$8B$je(B)e$B!"e(B
|> e$B$3$N%(%s%3!<%G%#%s%0$r;}$De(B(e$BI,MW$J$iJQ49$9$ke(B)e$B!#e(B
|
|e$BJQ49$r$5$;$k$J$iJQ49$r;XDj$9$k$[$&$,$$$$$s$8$c$J$$$G$7$g$&$+!#$?e(B
|e$B$H$($Pe(Binternale$B$r6u$K$7$?$H$-$K$Oe(Bdefaulte$B$r;H$&$H$+!#e(B

e$B!VJQ49$r$5$;$k$J$iJQ49$r;XDj$9$k!W$H$$$&$N$O6qBNE*$K$O$I$&$$e(B
e$B$&0UL#$G$7$g$&!#e(B

e$B;d$K$O!Ve(Binternale$B$r6u$K$7$?$H$-$K$Oe(Bdefaulte$B$r;H$&!W$He(B
e$B!Ve(Bdefault_internale$B$Oe(BIOe$B$Ge(Binternale$B$r;XDj$7$J$+$C$?>l9g$N%(%s%3!<e(B
e$B%G%#%s%0$G$"$k!W$OF1$80UL#$N$h$&$K46$8$i$l$^$9$,!#e(B

e$B$b$A$m$s:#8e$H$bL@<(E*$K;XDj$7$?>l9ge(B(e$B%b!<%I$Ge(B
e$B!Ve(Br:euc-jp:utf-8e$B!W$J$I$H$7$F$$$?>l9ge(B)e$B$dL@<(E*$KJQ49$7$?>l9ge(B
(str.encode(“iso-2022-jp”)e$B$N$h$&$Ke(B)e$B$K$OJQ49$,9T$o$l$^$9!#e(B

e$B:#2s$NDs0F$G$O!"e(Bdefault_internale$B$,;XDj$5$l$F$$$k>l9ge(B

open(path, “r”)

e$B$G!"e(Bdefault_externale$B$+$ie(Bdefault_internale$B$X$NJQ49$,9T$o$l$k$He(B
e$B$$$&0UL#$G!“0EL[$NJQ49$,H/@8$9$k$3$H$K$J$j!”$+$J$jBg$-$JJ}?Ke(B
e$BJQ99$G$9!#e(B

|e$B!Ve(B:e$B!W$J$7$Ge(B -E euc-jp e$B$J$I$H;XDj$7$?>l9g$O$I$&$J$k$s$G$7$g$&$+!#e(B

e$B0J2<$NI=$r=q$$$F$_$^$7$?!#;29M$K$7$F$/$@$5$$e(B

         default_external   default_internal

±------±------------------±------------------+
| -L | locale | locale |
|-E :i | locale | i |
|-E e | e | e |
|-E e:i | e | i |
|(e$B$J$7e(B) | locale | UTF-8 |
±------±------------------±------------------+

|e$B$^$?!"e(Binternale$B$He(Bexternale$B$=$l$>$l$@$1$r;XDj$9$k%*%W%7%g%s$rJ#?t;Xe(B
|e$BDj$7$?>l9g$H$+!#e(B

-Ee$B%*%W%7%g%s$Oe(B1e$BEY$7$+<u$1IU$1$J$$$3$H$K$7$h$&$H;W$C$F$$$^$9!#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:36536] Re: Encoding.default_internal
e$B$N$?$a$N%Q%C%Ae(B”
on Thu, 25 Sep 2008 06:43:25 +0900, “NARUSE, Yui”
[email protected] writes:

|e$B$`!"e(BUTF-{16,32} e$B$KBP$9$k8+DL$7$,$o$?$7$H<c430c$&$+$b!#e(B
|
|e$B;W$&$K!“8=:7|0F$N=t!9$NLdBj$K0lDL$j2r$O$"$C$F!"C<E*$K8@$($Pe(B
|e$B!Ve(B7bit ASCII String e$B$re(B UTF-16 e$B$K$7$F$/$C$D$1$l$P$$$$$@$1!W$G$9!#e(B
|
|e$BNc$($P!"e(BUTF-16LE e$B$Ne(B str="e$B$“e(B” e$B$KBP$7$Fe(B “text=#{str}” e$B$r9T$C$?>l9g!"e(B
|e$B4|BT$5$l$kF0:n$Oe(B UTF-16LE e$B$Je(B “text=e$B$“e(B” e$B$K7h$^$C$F$$$^$9!#e(B
|e$B$D$^$j!”;EMM>e$NG:$
$O$”$j$^$;$s!#e(B
|e$B<BAu$be(B “text=”.encode(“UTF-16LE”) e$B$9$k$@$1$G$9$N$G!“LdBj$”$j$^$;$s!#e(B

e$B8D?ME*$J0u>]$G$Oe(B"text=#{str}“e$B$N%(%s%3!<%G%#%s%0$r;;Dj$9$k$K$“e(B
e$B$?$C$F!”<g$H$J$k$N$O$”$/$^$G$b%F%-%9%H$=$N$b$N$G!“e(Bstre$B$N%(%s%3!<e(B
e$B%G%#%s%0$rM%@h$9$k$3$H$O9M$($F$b$$^$;$s$G$7$?!#:#!"2~$a$F9Me(B
e$B$($F$
$F$b$+$J$j0cOB46$,$”$j$^$9!#e(B

|e$B@55,I=8=$b;EMM>e$NG:$_$OA4$/$"$j$^$;$s!#e(B
|e$B<BAu$b!“e(BUS-ASCII or UTF-8 e$B$J$i$PN”$Ge(B UTF-16LE e$B$K%3%s%Q%$%k$7$J$$9!“e(B
|e$B$H$$$&J}K!$,$”$j$^$9!#e(B
|e$B6qBNE
$K$Oe(B Regexp.new(/\u3042/.source.encode(“UTF-16LE”)) e$B$H4JC1$J$b$N$G$9!#e(B
|
|e$B$D$^$j!"FC$KG:$`E@$OB?$/$J$/!“C1$K;~4V$,B-$j$J$$$@$1$G$9!#e(B
|e$B$H$O$$$(!”:n6HNL$b@dK>E*$J$[$IB?$$$o$1$G$b$J$$$N$G!"e(B
|e$BJ*9%$-$,0l?M8=$l$l$PJRIU$/NL$G$7$g$&!#e(B

e$B$3$A$i$K$D$$$F$O0[O@$O$"$j$^$;$s!#e(B

|e$B0J>e$N$h$&$K!"e(BUTF-{16,32} e$B$O%P%$%HNs$H$7$F$Oe(B ASCII e$BHs8_49$G$b!"e(B
|e$B%3!<%I%]%$%s%HNs$H$7$F$Oe(B ASCII e$B8_49$J$N$G!"e(B
|e$B$=$3$^$GG:$_$,B?$$$o$1$G$O$J$$$N$G$9!#e(B

e$B$H$O$$$(!“e(BUTF-16e$B$r:o=|$7$h$&$H$$$&$N$O!”$=$l$[$I6/$$<gD%$G$Oe(B
e$B$J$$$N$G!“!V;D$7$?J}$,$h$$!W$H$$$&@<$,Bg$-$1$l$Pe(B(e$B<B:]$9$G$Ke(B
e$B$”$,$C$F$$$^$9$,e(B)e$B!";D$7$F$b$+$^$o$J$$$H;W$C$F$$$^$9!#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:36554] Re: Encoding.default_internal
e$B$N$?$a$N%Q%C%Ae(B”
on Thu, 25 Sep 2008 15:23:00 +0900, Martin D.
[email protected] writes:

|>-Ee$B%*%W%7%g%s$Oe(B1e$BEY$7$+<u$1IU$1$J$$$3$H$K$7$h$&$H;W$C$F$$$^$9!#e(B
|
|e$B5$;}$A$OJ,$+$j$^$9$,!"%9%/%j%W%H$N%f!<%6$,30$Ge(B -E extenal,
|e$B%9%/%j%W%H$N%W%m%0%i%^$,Cf$Ge(B (e$B$9$J$o$Ae(B #! e$B$Ge(B) -E :internal
|e$B$r;XDj$9$k>l9g$OB?$$$KA[A|$G$-$k5$$,$7$^$9!#e(B

e$B$H$O$$$(!"$=$N$h$&$Ke(B-Ee$B$,J#?t;XDj$5$l$?>l9g$K!V$U$5$o$7$$F0:n!We(B
e$B$H$$$&$N$ODj5A$G$-$J$$$h$&$K;W$$$^$9!#$@$H$9$k$H%(%i!<$7$+BPe(B
e$B1~$7$h$&$,$J$$$N$G$O$J$$$G$7$g$&$+!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

|e$B$b$72DG=$G$"$k$J$i!$%j%j!<%9%9%1%8%e!<%k$K$*$$$F!$e(B
|core e$B$Ne(B feature freeze e$B$+$ie(B ext e$B$Ne(B feature freeze e$B$^$G$Ke(B
|e$B>/$74V$r6u$1$F$$$?$@$1$k$H=u$+$j$^$9!%e(B

e$B$3$l$K$D$$$F$b?=$7Lu$J$/;W$$$^$9!#e(BYuguie$B$5$s$H$O$^$@$A$c$s$He(B
e$BOC$7$F$$$^$;$s$,!":#2s$NJQ99$K$D$$$F$NBP1~$Oe(Bfreezee$B$NBP>]$G$Oe(B
e$B$J$$$H$$$&$3$H$K$G$-$?$i$$$$$H;W$C$F$$$^$9!#$G$-$l$Pe(B1e$B%v7n$/e(B
e$B$i$$$N4|4V$G!#e(B

(e$B7h$a$k$N$Oe(Byuguie$B$5$s$G$9$,e(B)e$BH?BP$7$^$9!#%U%j!<%:$K4V$K9g$o$J$$$h$&$J$b$Ne(B
e$B$OF~$l$k$Y$-$G$O$J$$$7!"$b$7$I$&$7$F$bF~$l$k$J$iA4BN$r%j%9%1%8%e!<%k$9$Ye(B
e$B$-$G$9!#e(B

e$B2a5n$+$i$J$s$bJY6/$7$F$J$$$N$+e(B?

At 14:58 08/09/25, Yukihiro M. wrote:

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

In message “Re: [ruby-dev:36550] Re: Encoding.default_internal e$B$N$?$a$N%Q%C%Ae(B”
on Thu, 25 Sep 2008 14:30:53 +0900, Nobuyoshi N.
[email protected] writes:

|e$B$^$?!"e(Binternale$B$He(Bexternale$B$=$l$>$l$@$1$r;XDj$9$k%*%W%7%g%s$rJ#?t;Xe(B
|e$BDj$7$?>l9g$H$+!#e(B

-Ee$B%*%W%7%g%s$Oe(B1e$BEY$7$+<u$1IU$1$J$$$3$H$K$7$h$&$H;W$C$F$$$^$9!#e(B

e$B5$;}$A$OJ,$+$j$^$9$,!"%9%/%j%W%H$N%f!<%6$,30$Ge(B -E extenal,
e$B%9%/%j%W%H$N%W%m%0%i%^$,Cf$Ge(B (e$B$9$J$o$Ae(B #! e$B$Ge(B) -E
:internal
e$B$r;XDj$9$k>l9g$OB?$$$KA[A|$G$-$k5$$,$7$^$9!#e(B

e$B59$7$/$*4j$$$7$^$9!#e(B Martin.

#-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-# http://www.sw.it.aoyama.ac.jp mailto:[email protected]

e$B$J$+$@$G$9!#e(B

At Thu, 25 Sep 2008 14:58:36 +0900,
Yukihiro M. wrote in [ruby-dev:36551]:

e$B!VJQ49$r$5$;$k$J$iJQ49$r;XDj$9$k!W$H$$$&$N$O6qBNE*$K$O$I$&$$e(B
e$B$&0UL#$G$7$g$&!#e(B

e$B;d$K$O!Ve(Binternale$B$r6u$K$7$?$H$-$K$Oe(Bdefaulte$B$r;H$&!W$He(B
e$B!Ve(Bdefault_internale$B$Oe(BIOe$B$Ge(Binternale$B$r;XDj$7$J$+$C$?>l9g$N%(%s%3!<e(B
e$B%G%#%s%0$G$"$k!W$OF1$80UL#$N$h$&$K46$8$i$l$^$9$,!#e(B

e$B!Ve(B:e$B!W$,$"$l$PJQ49$"$j!"$J$1$l$P$=$N$^$^$H$$$&$3$H$G$9!#e(B

[ruby-dev:36552]e$B$K$"$k!"e(B

e$B$A$g$C$H6l$7$$$G$9$,!"e(B

open(path, “r:default_external:”)

e$B$re(Bdefault_internale$B$r;H$&;XDj$H$7$F!"e(B

open(path, “r:external”)

e$B$O:#$^$G$HF1$8$/L5JQ49$Ge(Bexternale$B$H$7$FFI$_9~$`!"$H$$$&$N$O$I$&$Ge(B
e$B$7$g$&!#e(B

e$B:#2s$NDs0F$G$O!"e(Bdefault_internale$B$,;XDj$5$l$F$$$k>l9ge(B

open(path, “r”)

e$B$G!"e(Bdefault_externale$B$+$ie(Bdefault_internale$B$X$NJQ49$,9T$o$l$k$He(B
e$B$$$&0UL#$G!“0EL[$NJQ49$,H/@8$9$k$3$H$K$J$j!”$+$J$jBg$-$JJ}?Ke(B
e$BJQ99$G$9!#e(B

         default_external   default_internal

±------±------------------±------------------+
| -L | locale | locale |
|-E :i | locale | i |
|-E e | e | e |
|-E e:i | e | i |
|(e$B$J$7e(B) | locale | UTF-8 |
±------±------------------±------------------+

default_internale$B$J$7!"$H$$$&;XDj$O$G$-$J$$$o$1$G$9$+!#e(B

|e$B$^$?!"e(Binternale$B$He(Bexternale$B$=$l$>$l$@$1$r;XDj$9$k%*%W%7%g%s$rJ#?t;Xe(B
|e$BDj$7$?>l9g$H$+!#e(B

-Ee$B%*%W%7%g%s$Oe(B1e$BEY$7$+<u$1IU$1$J$$$3$H$K$7$h$&$H;W$C$F$$$^$9!#e(B

e$B%3%^%s%I%i%$%s!"e(BRUBYOPTe$B!“e(Bshebange$B$=$l$>$l$G0lEY$:$D!”$G$7$g$&$+!#e(B

e$B@.@%$G$9!#e(B

Yukihiro M. wrote:

|e$BNc$($P!"e(BUTF-16LE e$B$Ne(B str="e$B$“e(B” e$B$KBP$7$Fe(B “text=#{str}” e$B$r9T$C$?>l9g!“e(B
|e$B4|BT$5$l$kF0:n$Oe(B UTF-16LE e$B$Je(B “text=e$B$“e(B” e$B$K7h$^$C$F$$$^$9!#e(B
|e$B$D$^$j!”;EMM>e$NG:$_$O$”$j$^$;$s!#e(B
|e$B<BAu$be(B “text=”.encode(“UTF-16LE”) e$B$9$k$@$1$G$9$N$G!“LdBj$”$j$^$;$s!#e(B

e$B8D?ME*$J0u>]$G$Oe(B"text=#{str}“e$B$N%(%s%3!<%G%#%s%0$r;;Dj$9$k$K$“e(B
e$B$?$C$F!”<g$H$J$k$N$O$”$/$^$G$b%F%-%9%H$=$N$b$N$G!“e(Bstre$B$N%(%s%3!<e(B
e$B%G%#%s%0$rM%@h$9$k$3$H$O9M$($F$b$$^$;$s$G$7$?!#:#!"2~$a$F9Me(B
e$B$($F$
$F$b$+$J$j0cOB46$,$”$j$^$9!#e(B

e$B$b$A$m$sBh0l$K$O!V%F%-%9%H$=$N$b$N!W$Ne(B encoding e$B$G!“e(B
e$BNc$($Pe(B Shift_JIS e$B$de(B EUC-JP e$B$G$”$l$Pe(B Incompatible
e$B$G$7$g$&!#e(B
e$B0lJ}e(B ASCII only e$B$J$i$P!“e(BASCII Compatible encoding
e$BF1MM$Ke(B
UTF-16LE
e$B$KB7$($k$H$$$&$N$O$=$3$^$G0cOB46$N$”$kF0$-$G$O$J$$$H;W$$$^$9!#e(B

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

In message “Re: [ruby-dev:36564] Re: Encoding.default_internal
e$B$N$?$a$N%Q%C%Ae(B”
on Thu, 25 Sep 2008 21:30:05 +0900, “NARUSE, Yui”
[email protected] writes:

|> e$B8D?ME*$J0u>]$G$Oe(B"text=#{str}“e$B$N%(%s%3!<%G%#%s%0$r;;Dj$9$k$K$“e(B
|> e$B$?$C$F!”<g$H$J$k$N$O$”$/$^$G$b%F%-%9%H$=$N$b$N$G!“e(Bstre$B$N%(%s%3!<e(B
|> e$B%G%#%s%0$rM%@h$9$k$3$H$O9M$($F$b$$^$;$s$G$7$?!#:#!"2~$a$F9Me(B
|> e$B$($F$
$F$b$+$J$j0cOB46$,$”$j$^$9!#e(B
|
|e$B$b$A$m$sBh0l$K$O!V%F%-%9%H$=$N$b$N!W$Ne(B encoding e$B$G!“e(B
|e$BNc$($Pe(B Shift_JIS e$B$de(B EUC-JP e$B$G$”$l$Pe(B Incompatible e$B$G$7$g$&!#e(B
|e$B0lJ}e(B ASCII only e$B$J$i$P!“e(BASCII Compatible encoding e$BF1MM$Ke(B
|UTF-16LE e$B$KB7$($k$H$$$&$N$O$=$3$^$G0cOB46$N$”$kF0$-$G$O$J$$$H;W$$$^$9!#e(B

e$B$=$&$J$s$G$9$+!#;d$K$Oe(Bascii compatiblee$B$H$$$&@-<A$r<:$&$3$H$Ke(B
e$B$OBgJQBg$-$JDq93$,$"$j$^$9!#B>$N?M$N0U8+$bJ9$-$?$$$H$3$m$G$9!#e(B

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

e$B0lIt=g=x$rA08e$7$^$9!#e(B

In message “Re: [ruby-dev:36559] Re: Encoding.default_internal
e$B$N$?$a$N%Q%C%Ae(B”
on Thu, 25 Sep 2008 17:07:34 +0900, Nobuyoshi N.
[email protected] writes:

|> default_external default_internal
|> ±------±------------------±------------------+
|> | -L | locale | locale |
|> |-E :i | locale | i |
|> |-E e | e | e |
|> |-E e:i | e | i |
|> |(e$B$J$7e(B) | locale | UTF-8 |
|> ±------±------------------±------------------+
|
|default_internale$B$J$7!"$H$$$&;XDj$O$G$-$J$$$o$1$G$9$+!#e(B

e$B!Ve(Bdefault_internale$B$,$J$$!W$H$$$&$N$O$I$&$$$&$3$H$+$H9M$($k$He(B

  • e$B30It%F%-%9%H$re(Bdefault_externale$B$H$7$FFI$_9~$_e(B
  • e$BFbIt$Ke(Bdefault_externale$B%(%s%3!<%G%#%s%0$rIU2C$7$?J8;zNs$re(B
    e$B<h$j9~$`e(B

e$B$H$$$&$3$H$G$9$+$i!"!Ve(Bdefault_internale$B$,$J$$e(B(e$B8=>ue(B)e$B!W$He(B
e$B!Ve(Bdefault_externale$B$He(Bdefault_internale$B$,F1$8!W$H$$$&$N$OF1$8$3e(B
e$B$H$@$H;W$$$^$9!#e(B

|> e$B;d$K$O!Ve(Binternale$B$r6u$K$7$?$H$-$K$Oe(Bdefaulte$B$r;H$&!W$He(B
|> e$B!Ve(Bdefault_internale$B$Oe(BIOe$B$Ge(Binternale$B$r;XDj$7$J$+$C$?>l9g$N%(%s%3!<e(B
|> e$B%G%#%s%0$G$“$k!W$OF1$80UL#$N$h$&$K46$8$i$l$^$9$,!#e(B
|
|e$B!Ve(B:e$B!W$,$”$l$PJQ49$“$j!”$J$1$l$P$=$N$^$^$H$$$&$3$H$G$9!#e(B

e$B$h$j4J7i$J5-K!$,?d>)$5$l$kJ}<0$r0E<($9$k$3$H$,B?$$$o$1$G$9$,!“e(B
default_internale$B$,;XDj$5$l$F$$$k$N$K$b$+$+$o$i$:!“30It%(%s%3!<e(B
e$B%G%#%s%0$rJQ49$J$7$KFI$_9~$`$H$$$&$3$H$Oe(B(e$B$=$l$,$,0[$J$C$F$$$?e(B
e$B>l9ge(B)e$B!“7k6I$I$3$+$Ge(Bencodee$B%a%=%C%I$r8F$VI,MW$,$”$j!”%=%U%H%&%'e(B
e$B%”%H!<%?%k$G$NJ#;(@-$,A}$9$?$a!“$”$^$j?d>)$7$?$/$"$j$^$;$s!#e(B

|[ruby-dev:36552]e$B$K$"$k!"e(B
|> e$B$A$g$C$H6l$7$$$G$9$,!"e(B
|>
|> open(path, “r:default_external:”)
|
|e$B$re(Bdefault_internale$B$r;H$&;XDj$H$7$F!“e(B
|
| open(path, “r:external”)
|
|e$B$O:#$^$G$HF1$8$/L5JQ49$Ge(Bexternale$B$H$7$FFI$_9~$`!”$H$$$&$N$O$I$&$Ge(B
|e$B$7$g$&!#e(B

|> -Ee$B%*%W%7%g%s$Oe(B1e$BEY$7$+<u$1IU$1$J$$$3$H$K$7$h$&$H;W$C$F$$$^$9!#e(B
|
|e$B%3%^%s%I%i%$%s!"e(BRUBYOPTe$B!“e(Bshebange$B$=$l$>$l$G0lEY$:$D!”$G$7$g$&$+!#e(B

e$B$$$(!“A4BN$rDL$8$F0lEY$G$9!#J#?t;XDj$7$?$iL7=b$r2r>C$9$k<jCJe(B
e$B$,$”$j$^$;$s$+$i!#e(B

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

e$B$^$D$b$He(B e$B$f$-$R$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j$^$9!#e(B

e$B$3$N7k2L!"3F<o%i%$%V%i%j$Oe(B

  • e$B4pK\e(BUTF-8e$B$rJV$;$P$h$$!"F~NO$be(BUTF-8e$B$r4|BTe(B
  • e$B$h$j?F@Z$J%i%$%V%i%j$Oe(Bdefault_internale$B$GJV$9!#F~NO$Oe(B
    encodinge$B$r8+$FBP=he(B

e$B$3$3$O$A$g$C$H?4G[$N$H$3$m$G$9!#FC$K309q$N%W%m%0%i%^$Oe(B
e$B!VA4Ite(B UTF-8 e$B$G$d$C$F$7$^$&!WF08~$,6/$$$G$7$g$&!#e(B
e$B$=$l$G$$$$$H$$$&2DG=@-$b$"$j$^$9$,!"$=$&$G$O$J$$2DG=@-$be(B
e$B$"$j$^$9!#e(B

e$B$3$3$O6/$/7|G0$9$kE@$N0l$D$G!"$3$3$^$Ge(B UTF-8
e$B$r6/$/?d>)$7$F$7$^$&$H!"e(B
e$B$J$s$GB>$Ne(B encoding e$B$KBP1~$7$J$$$H$$$1$J$$$N!)$H$+!“e(B
e$B$=$b$=$b$J$s$GB>$Ne(B encoding e$B$KBP1~$9$kI,MW$,$”$C$?$Ne(B?
e$B$H$$$&Ld$$$KEz$($E$i$/$J$j$^$9!#e(B

default_internal e$B$,6u$N>l9g$Oe(B default_external e$B$GJV$9$N$G$9$+$M!#e(B

e$B%Q%C%A$r:n$C$?$H$-$K!"!Ve(Bdefault_internal e$B$,6u$J$ie(B default_externale$B!We(B
e$B$rJV$95!G=$NI,MW@-$r46$8;O$a$^$7$?!#e(B

e$B$J$+$@$5$s$,;XE&$J$5$C$F$^$9$,!"C1=c$K$d$k$HFq$7$+$C$?$j$7$^$9!#e(B

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

In message “Re: [ruby-dev:36576] Re: Encoding.default_internal
e$B$N$?$a$N%Q%C%Ae(B”
on Fri, 26 Sep 2008 00:29:09 +0900, “NARUSE, Yui”
[email protected] writes:

|e$B$3$3$O6/$/7|G0$9$kE@$N0l$D$G!"$3$3$^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$&%k!<%k$@$C$?$O$:$G$9!#e(B
e$B$J$N$G!”$^$!!"Dj5A$O$G$-$^$9!#e(B

e$B@.@%$G$9!#e(B

Yukihiro M. wrote:

|> |-E :i | locale | i |

  • e$BFbIt$Ke(Bdefault_externale$B%(%s%3!<%G%#%s%0$rIU2C$7$?J8;zNs$re(B
    e$B<h$j9~$`e(B

e$B$H$$$&$3$H$G$9$+$i!"!Ve(Bdefault_internale$B$,$J$$e(B(e$B8=>ue(B)e$B!W$He(B
e$B!Ve(Bdefault_externale$B$He(Bdefault_internale$B$,F1$8!W$H$$$&$N$OF1$8$3e(B
e$B$H$@$H;W$$$^$9!#e(B

e$B0c$&$H;W$$$^$9!#e(B

open(file, “r:utf-8”) e$B$H=q$$$?$H$-!"e(B
default_internal == nil e$B$J$i$P!"e(Bopen(file, “r:utf-8:utf-8”)
e$B$K$J$j$^$9!#e(B
e$B$7$+$7!"e(Bdefault_internal == locale e$B$O!"e(Bopen(file,
“r:utf-8:locale”) e$B$G$9!#e(B

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

In message “Re: [ruby-dev:36580] Re: Encoding.default_internal
e$B$N$?$a$N%Q%C%Ae(B”
on Fri, 26 Sep 2008 02:11:09 +0900, “NARUSE, Yui”
[email protected] writes:

|> e$B!Ve(Bdefault_internale$B$,$J$$e(B(e$B8=>ue(B)e$B!W$He(B
|> e$B!Ve(Bdefault_externale$B$He(Bdefault_internale$B$,F1$8!W$H$$$&$N$OF1$8$3e(B
|> e$B$H$@$H;W$$$^$9!#e(B
|
|e$B0c$&$H;W$$$^$9!#e(B
|
|open(file, “r:utf-8”) e$B$H=q$$$?$H$-!"e(B
|default_internal == nil e$B$J$i$P!"e(Bopen(file, “r:utf-8:utf-8”) e$B$K$J$j$^$9!#e(B
|e$B$7$+$7!"e(Bdefault_internal == locale e$B$O!"e(Bopen(file, “r:utf-8:locale”) e$B$G$9!#e(B

e$B$U$`!#$=$&$+!#8+Mn$H$7$F$?$J!#e(B
e$B$A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I,MW$,$”$j$^$9!#e(B
e$B$=$&$9$l$P!”@h$Ne(B1. 2. e$B$N%a%j%C%H$,??$K5}<u=PMh$k$@$1$G$J$/!"e(B
e$B@h=R$N%j%F%i%k$NLdBj$b2r7h$G$-$^$9!#e(B

e$B$7$+$7!"$3$l$r$d$k$He(B Unicode e$B%5%]!<%H$,IO<e8=>u$G$O!“e(B
e$B$”$^$j$K8+1I$($N$7$J$$BeJ*$K$J$C$F$7$^$$$^$9!#e(B

e$B$=$N$?$a!"$3$NJ}?K$G@h?JE*$K$J$m$&$H$9$k$J$i$P!“e(B
Grapheme Cluster e$BEy$Ne(B Unicode
e$B%5%]!<%H$rBgI}$K6/2=$9$kI,MW$,$”$k$G$7$g$&!#e(B
e$B$3$l$O8@$&$^$G$b$J$/:#G/Cf$K$OIT2DG=$G$9!#e(B
e$B$^$?!"e(BUniocde
e$B<+BN!"[email protected];z<~$j$O$^$@:n$j$3$_$,I,MW$K8+$($^$9$7!"e(B
e$B0[BN;z$O$^$@$^$@;O$^$C$?$P$+$j$G$9!#e(B
e$B;W$&$K!"e(BUnicode e$B2=e(B e$B$Oe(B 2.0
e$BAw$j$K$7$F!"FbIt$r40A4$Ke(B UTF-32 e$B$K7h$a$F$7$^$$!"e(B
e$B%j%F%i%k$b2?$b$+$bFbIt$G$Oe(B UTF-32

e$B5U$K8@$($P!“e(BEncoding.default_internal e$B$N%G%U%)%k%He(B UTF-8
e$BF3F~$OCfESH>C<$9$.$^$9!#e(B
e$B$3$l$C$F!”$D$^$k$H$3$me(B STDC_ISO_10646
e$B$r%G%U%)%k%H$GDj5A$7$Fe(B
e$BFM$C9~$s$8$c$&$h$&$J$b$N$J$o$1$G!#e(B

e$B7k6I$N$H$3$m!“e(BRuby 1.9 e$B$K$$$$F$O!"e(B
e$B8=<BE
$KJQ$($i$l$kHO0O$G$O8=>u$O$=$l$J$j$K%P%i%s%9$N<h$l$?$b$N$G$”$j!“e(B
Encoding.default_internal e$B$r%G%U%)%k%He(B nil
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sep 2008 11:02:10 +0900, Urabe S.
[email protected] writes:

|> e$BA4BN$N%j%9%1%8%e!<%k$K$OH?BP$7$^$;$s!#e(B
|
|1.9.1e$B$K4^$a$J$$$H$$$&Ds0F$K$O;?@.$bH?BP$b$$$?$@$1$F$^$;$s$,!"$=$l$O$I$&e(B
|e$B$*9M$($G$9$+!#e(B

1.9.1e$B$K4^$a$J$$$H$$$&A*Br$Oe(B

  • 1.9.2e$B$KF~$l$k$N$G$OHs8_49@-$,Bg$-$$e(B
  • 2.0e$B$^$GBT$D$N$O@h$,1s$9$.$ke(B

e$B$N$G!“$I$J$?$+$,;d$r@Q6KE*$K@bF@$7$J$$8B$j!”:NMQ$7$?$/$"$j$^e(B
e$B$;$s!#e(B