When default_internal specified


#1

e$B$3$s$P$s$Oe(B sheepman e$B$G$9!#e(B

default_external e$B$He(B default_internal e$B$,;XDj$5$l$?$H$-!"e(B
e$B=q$-9~$_;~$K%(%s%3!<%G%#%s%0$NJQ49$,5/$3$k$h$&$G$9$,!"e(B
e$B$3$l$O$3$&$$$&$b$N$G$7$g$&$+!#e(B

$ cat t.rb

encoding:euc-jp

io = File.open(‘t.txt’, ‘w+’)
io.write(“e$B$[$2e(B\n”)

$ ruby-1.9 -Esjis:euc-jp t.rb
ruby 1.9.2dev (2009-04-04 trunk 23134) [i686-linux]

$ nkf --guess t.txt
Shift_JIS

e$B$=$N>l9g!"$k$j$^$N5-;v$,4V0c$C$F$$$k$H;W$$$^$9!#e(B
http://jp.rubyist.net/magazine/?0025-Ruby19_m17n#l65


#2

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

sheepman wrote:

e$B$3$s$P$s$Oe(B sheepman e$B$G$9!#e(B

default_external e$B$He(B default_internal e$B$,;XDj$5$l$?$H$-!"e(B
e$B=q$-9~$_;~$K%(%s%3!<%G%#%s%0$NJQ49$,5/$3$k$h$&$G$9$,!"e(B
e$B$3$l$O$3$&$$$&$b$N$G$7$g$&$+!#e(B

default_internale$B$,e(BIOe$B%%V%8%’%/%H$KH?1G$5$l$k%?%$%_%s%0$,$$+$7$$$h$&$Ke(B
e$B46$8$F$$$k$N$G$9$,!"$"$k$Y$-F0:n$r$^$@$^$H$a$i$l$F$$$^$;$s!#e(B

e$B$H$j$"$($:$3$NJU$j$,$*$+$7$$$3$H$OG’<1$7$^$7$?!#e(B


#3

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

NARUSE, Yui wrote:

sheepman wrote:

default_external e$B$He(B default_internal e$B$,;XDj$5$l$?$H$-!"e(B
e$B=q$-9~$_;~$K%(%s%3!<%G%#%s%0$NJQ49$,5/$3$k$h$&$G$9$,!"e(B
e$B$3$l$O$3$&$$$&$b$N$G$7$g$&$+!#e(B

default_internale$B$,e(BIOe$B%%V%8%’%/%H$KH?1G$5$l$k%?%$%_%s%0$,$$+$7$$$h$&$Ke(B
e$B46$8$F$$$k$N$G$9$,!"$"$k$Y$-F0:n$r$^$@$^$H$a$i$l$F$$$^$;$s!#e(B

e$B$H$j$"$($:$3$NJU$j$,$*$+$7$$$3$H$OG’<1$7$^$7$?!#e(B

e$BCY$/$J$j$^$7$?$,!"$3$NF0:n$,;EMM$G$"$j!"$k$S$^$,8m$C$F$$$k$H$$$&$3$H$K$7$^$7$?!#e(B
e$B$k$S$^$N5-;v$ODI$C$F=$@5$7$^$9!#e(B