Rb_filesystem_encoding on Unix

Unix e$B$G!“C10l$Ne(B locale e$B$K=>$C$F1?MQ$7$F$$$k>l9g$O!”%(%s%3!<e(B
e$B%G%#%s%0$r$J$K$b;X<($7$J$/$F$bE,@Z$KJ8;z$r07$($k$h$&F0:n$9$ke(B
e$B$N$,$h$$$H;W$$$^$9!#e(B

e$B$D$^$j!"e(B

% date > xyze$B$O$O$Oe(B
% ./ruby -e ‘p Dir.entries(".").grep(/xyz/)’
[“xyz\xA4\xCF\xA4\xCF\xA4\xCF”]

e$B$G$J$/!"e(B

% ./ruby -e ‘p Dir.entries(".").grep(/xyz/)’
[“xyze$B$O$O$Oe(B”]

e$B$H$J$k$N$,$h$$$N$G$O$J$$$G$7$g$&$+!#e(B

e$B%W%m%0%i%`$r=q$/N)>l$H$9$k$H!"%U%!%$%kL>$rJ8;[email protected]$7$/07e(B
e$B$($k$h$&[email protected]$$O!"e(B

  • e$B%W%m%0%i%`$G$J$/!“4D6-$K$”$ke(B
    (e$B%U%!%$%kL>$r$R$H$D$Ne(B locale e$B$K=>$C$F1?MQ$7$F$$$k$3$H$r2>e(B
    e$BDj$9$ke(B)

e$B$H$$$&N)>l$H!"e(B

  • e$B%W%m%0%i%`<+?H$K$"$ke(B
    (locale e$B$K=>$C$F$$$J$$$b$N$b$,$s$P$C$F07$&e(B)

e$B$H$$$&N>J}$NN)>l$,$"$j$($^$9$,!“8e<T$O$I$&$;%W%m%0%i%`Fb$G$$e(B
e$B$m$$$m$JBP=h$,I,MW$J$N$G!”$J$K$b;XDj$7$J$1$l$PA0<T$rA[Dj$7!“e(B
e$BA0<T$N2>Dj$,@.$jN)$D8B$j$K$*$$$FJ8;z$r$=$N$^$^07$($k$h$&$K$9e(B
e$B$k$N$,NI$$$H;W$$$^$9!#$=$&$9$l$P!”$H$j$"$($:A0<T$NN)>l$G$O9,e(B
e$B$;$K$J$l$^$9!#e(B

e$B$=$N$?$a$K$O!"%7%9%F%`[email protected]$?%P%$%HNs$N%U%!%$%kL>$K$O!"$H$/e(B
e$B$K;XDj$,$J$$8B$j!"e(Blocale encoding e$B$r$D$1$k$Y$-$G$9!#e(B

% svn diff --diff-cmd diff -x ‘-u -p’ encoding.c
Index: encoding.c

— encoding.c (revision 18140)
+++ encoding.c (working copy)
@@ -967,7 +967,7 @@ rb_filesystem_encoding(void)
#elif defined APPLE
enc = rb_enc_find(“UTF8-MAC”);
#else

  • enc = rb_ascii8bit_encoding();
  • enc = rb_locale_encoding();
    #endif
    }
    return enc;

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

Tanaka A. wrote:

e$B$=$N$?$a$K$O!"%7%9%F%`[email protected]$?%P%$%HNs$N%U%!%$%kL>$K$O!"$H$/e(B
e$B$K;XDj$,$J$$8B$j!"e(Blocale encoding e$B$r$D$1$k$Y$-$G$9!#e(B

e$B$*$C$H!"$=$&$7$h$&$H;W$C$FK:$l$F$$$^$7$?!#e(B
e$B;[email protected]$7$^$9!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs