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1$J$N$G!“%I%i%$%P$,%(%s%3!<%G%#%s%0$r@_Dj$7$?J}$,$h$$$H$$e(B
e$B$&$N$b@bF@NO$,$”$j$^$9!#e(BDBe$B%I%i%$%P$K$D$$$F$Oe(BASCII-8BITe$B0F$r0ze(B
e$B$-2<$2$h$&$H;W$$$^$9!#e(B

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

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

At Fri, 30 Apr 2010 21:31:55 +0900,
Yukihiro M. wrote in [ruby-dev:41124]:

|> e$B%I%i%$%P$G$d$k$Y$-$+!"%U%l!<%%o!<%/$G$d$k$Y$-$+G:$^$7$$$H$3e(B |> e$B$m$G$9$M!#8D?ME*$K$O!"%"%@%W%?$+%U%l!<%%o!<%/$+$$$:$l$+$GBPe(B
|> e$B1~$7$F!"%I%i%$%P$Oe(BASCII-8BITe$B$rJV$9$Y$-$G$O$J$$$+$H;W$$$D$D$“e(B
|> e$B$j$^$9!#e(B
|
|e$B$$$m$$$m9M$($?$s$G$9$,!”!V$A$c$s$H@_Dj$7$me(BYO!e$B!W$C$F;XE&$7$F2s$k@h$O>/$J$$J}$,$$$$$N$G!“e(B
|e$B<B$O%I%i%$%P$G@_Dj$9$k$N$,%Y%9%H$8$c$J$$$+$H;W$$$D$D$”$j$^$9!#e(B

e$BF1MM$K!V>/$J$$J}$,$h$$!W$H$$$&M}M3$G!"e(BRailse$B$,BP1~$7$?J}$,NI$$e(B
e$B$H;W$C$?$N$G$9$,!#%I%i%$%P$O$=$l$>$l$K3+H/85$,$$$k$N$G!#e(B

DBe$B%I%i%$%P$r;H$&%"%W%j%1!<%7%g%s$d%U%l!<%`%o!<%/$O!“e(BRailse$B0J30$Ke(B
e$B$b$$$m$$$m$”$k$s$G$O$J$$$G$7$g$&$+!#e(B

2010/4/30 NARUSE, Yui [email protected]:

MySQL e$B$H$+e(B Oracle e$B$H$+$O$I$&$J$s$@$C$1e(B?

Oracle e$B$K4X$7$F$$$&$H!"$k$S$^$N!Ve(BRuby M17N e$B$N@_7W$H<BAu!W$Ne(B
IO e$B$N>Oe(B(*1)
e$B$r;29M$K$7$?<BAu$K$J$C$F$$$^$9!#e(B

Oracle e$B$Ne(B NLS_LANG e$B$He(B ruby
e$B$N%(%s%3!<%G%#%s%0$NBP1~I=e(B(*2)e$B$r0z$$$F!"e(B
Oracle
e$BB&$N%(%s%3!<%G%#%s%0e(B(e$B30It%(%s%3!<%G%#%s%0$KBP1~e(B)e$B$r7h$a$F!"e(B

  1. ruby e$B$Ne(B String e$B$re(B Oracle e$B$N4X?t$KEO$9$H$-e(B

ruby e$B$Ne(B String e$B$N%(%s%3!<%G%#%s%0$re(B Oracle
e$BB&$N%(%s%3!<%G%#%s%0$KJQ49e(B
e$B$7$F$+$ie(B Oracle e$B$N4X?t$KEO$9!#$?$@$7!"e(BRAW e$B7?!“e(BBLOB
e$B7?$N$H$-$O!”%(%s%3!<e(B
e$B%G%#%s%0$NJQ49$O9T$J$o$J$$!#e(B

  1. Oracle e$B$+$i<hF@$7$?J8;zNs$re(B ruby e$B$KJV$9$H$-e(B

e$BFbIt%(%s%3!<%G%#%s%0$,@_Dj$5$l$F$J$$$H$-$O!"e(BOracle
e$BB&$N%(%s%3!<%G%#%se(B
e$B%0$rJ8;zNs$K@_Dj$9$k!#FbIt%(%s%3!<%G%#%s%0$,@_Dj$5$l$F$$$k$H$-$O!"e(B
Oracle e$BB&$N%(%s%3!<%G%#%s%0$+$iFbIt%(%s%3!<%G%#%s%0$KJQ49$7$?>e$Ge(B
ruby
e$BB&$KJV$9!#$?$@$7!"e(BRAW e$B7?!"e(BBLOB
e$B7?$N$H$-$OFbIt%(%s%3!<%G%#%s%0$NCM$K$+e(B
e$B$+$o$i$:L5>r7o$Ke(BASCII-8BIT
e$B$r@_Dj$7!"J8;z%3!<%I$NJQ49$O9T$o$J$$!#e(B

*1 http://jp.rubyist.net/magazine/?0025-Ruby19_m17n#l63
*2
http://ruby-oci8.rubyforge.org/svn/trunk/ruby-oci8/lib/oci8/encoding.yml

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

(2010/05/02 0:35), KUBO Takehiro wrote:

e$B$+$o$i$:L5>r7o$Ke(BASCII-8BIT e$B$r@_Dj$7!"J8;z%3!<%I$NJQ49$O9T$o$J$$!#e(B

*1 http://jp.rubyist.net/magazine/?0025-Ruby19_m17n#l63
*2 http://ruby-oci8.rubyforge.org/svn/trunk/ruby-oci8/lib/oci8/encoding.yml

e$B$J$k$[$I!“@5$7$$$H;W$$$^$9!#e(B
e$B>pJs$”$j$,$H$&$4$6$$$^$9!#e(B

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

e$B>pJs$"$j$,$H$&$4$6$$$^$9!#e(B

(2010/05/05 10:03), e$B$H$_$?$^$5$R$me(B wrote:

ASCII-8BIT e$B0J30$NJ8;zNs$Oe(B MySQL e$B@\B3$Ne(B charset e$B$KJQ49$7$FEO$7$^$9!#e(B
ASCII-8BIT e$B$OJQ49$;$:$K$=$N$^$^EO$7$^$9!#e(B

e$B$3$A$i$O$h$$$H;W$$$^$9!#e(B

  1. MySQL e$B$+$iJ8;zNs$r<h$j=P$9>l9ge(B

e$B%P%$%J%j0J30$NJ8;zNs$Oe(B MySQL e$B@\B3$Ne(B charset e$B$KBP1~$9$ke(B encoding e$B$H$7$Fe(B
e$BJ8;zNs$r<h$j=P$7$^$9!#%P%$%J%jJ8;zNs$Oe(B ASCII-8BIT e$B$H$7$F<h$j=P$7$^$9!#e(B

MySQL e$B$O%5!<%P!<B&$G%+%i%$Ne(B charset e$B$+$i@\B3MQ$Ne(B charset e$B$KJQ49$9$k$Ne(B e$B$G!"<h$j=P$5$l$kJ8;zNs$Ne(B encoding e$B$O%+%i%$Ne(B charset e$B$K$h$i$:!"@\B3MQe(B
charset e$B$KBP1~$9$ke(B encoding e$B$K$J$j$^$9!#e(B

e$B$3$A$i$O!“%”%@%W%?B&$,@\B3$Ne(B charset e$B$re(B
Encoding.default_internal e$B$K$9$k$N$,e(B
e$B@52r$J$N$+$J$!!#e(B

Ruby encoding e$B$He(B MySQL charset e$B$NJQ49I=$OFbIt$G;}$C$F$^$9!#e(B
http://github.com/tmtm/ruby-mysql/blob/2.9/lib/mysql/charset.rb e$B$Ne(B CHARSET_ENCODING

TIS-620 e$B$Oe(B Ruby e$BB&$K$bMQ0U$7$F$$$^$9$M!#e(B

e$B$H$_$?$G$9!#e(B

On Fri, 30 Apr 2010 18:20:22 +0900
“NARUSE, Yui” [email protected] wrote:

MySQL e$B$H$+e(B Oracle e$B$H$+$O$I$&$J$s$@$C$1e(B?

pure Ruby e$BHG$Ne(B MySQL e$B$O<!$N$h$&$KF0$-$^$9!#e(B

Ce$BHGe(B MySQL e$B$Oe(B ASCII-8BITe$B!#e(B

  1. Ruby e$B$+$ie(B MySQL e$B$KJ8;zNs$rEO$9>l9ge(B

ASCII-8BIT e$B0J30$NJ8;zNs$Oe(B MySQL e$B@\B3$Ne(B charset
e$B$KJQ49$7$FEO$7$^$9!#e(B
ASCII-8BIT e$B$OJQ49$;$:$K$=$N$^$^EO$7$^$9!#e(B

  1. MySQL e$B$+$iJ8;zNs$r<h$j=P$9>l9ge(B

e$B%P%$%J%j0J30$NJ8;zNs$Oe(B MySQL e$B@\B3$Ne(B charset e$B$KBP1~$9$ke(B
encoding e$B$H$7$Fe(B
e$BJ8;zNs$r<h$j=P$7$^$9!#%P%$%J%jJ8;zNs$Oe(B ASCII-8BIT
e$B$H$7$F<h$j=P$7$^$9!#e(B

MySQL e$B$O%5!<%P!<B&$G%+%i%$Ne(B charset e$B$+$i@\B3MQ$Ne(B charset e$B$KJQ49$9$k$Ne(B e$B$G!"<h$j=P$5$l$kJ8;zNs$Ne(B encoding e$B$O%+%i%$Ne(B charset
e$B$K$h$i$:!"@\B3MQe(B
charset e$B$KBP1~$9$ke(B encoding e$B$K$J$j$^$9!#e(B

Ruby encoding e$B$He(B MySQL charset e$B$NJQ49I=$OFbIt$G;}$C$F$^$9!#e(B
http://github.com/tmtm/ruby-mysql/blob/2.9/lib/mysql/charset.rb e$B$Ne(B
CHARSET_ENCODING

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

In message “Re: [ruby-dev:41176] Re: Rails3 M17N”
on Thu, 6 May 2010 05:32:20 +0900, Yukihiro M.
[email protected] writes:

|Yehudae$B$Oe(Bdefault_internale$B$,%;%C%H$5$l$F$$$k;~$K$O%I%i%$%V$,$=e(B
|e$B$l$KJQ49$7$?J8;zNs$rJV$9$3$H$r4|BT$7$F$$$k$h$&$G$9!#JQ49$G$-e(B
|e$B$J$$;~$K$I$&$9$k$N$+IT0B$J$b$N$,$“$k$N$G$9$,e(B(e$BBeBXJ8;z!)e(B)e$B!”$=e(B
|e$B$l0J30$K$^$:$$$3$H$C$F$"$j$^$9!)e(B

e$B!V%I%i%$%V!W$8$c$J$/$F!V%I%i%$%P!W$M!#!V%“%@%W%?$8$c$@$a$Je(B
e$B$N!)!W$HJ9$$$?$i!”!V%“%@%W%?$r7PM3$7$J$$$Ge(BDBe$B$K%”%/%;%9$9$k%3!<e(B
e$B%I$b$“$k$+$i!”%I%i%$%P$NJ}$,K>$^$7$$!W$@$=$&$G$9!#e(B

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

In message “Re: [ruby-dev:41172] Re: Rails3 M17N”
on Thu, 6 May 2010 00:05:49 +0900, “NARUSE, Yui” [email protected]
writes:

|> MySQL e$B$O%5!<%P!<B&$G%+%i%$Ne(B charset e$B$+$i@\B3MQ$Ne(B charset e$B$KJQ49$9$k$Ne(B |> e$B$G!"<h$j=P$5$l$kJ8;zNs$Ne(B encoding e$B$O%+%i%$Ne(B charset e$B$K$h$i$:!“@\B3MQe(B
|> charset e$B$KBP1~$9$ke(B encoding e$B$K$J$j$^$9!#e(B
|
|e$B$3$A$i$O!”%"%@%W%?B&$,@\B3$Ne(B charset e$B$re(B Encoding.default_internal e$B$K$9$k$N$,e(B
|e$B@52r$J$N$+$J$!!#e(B

Yehudae$B$Oe(Bdefault_internale$B$,%;%C%H$5$l$F$$$k;~$K$O%I%i%$%V$,$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