Eval(str.dump)==str

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

1.8 [email protected]$He(B eval(str.dump) == str e$B$,e(B true e$B$K$J$j$^$9$,!“e(B
1.9 [email protected]$He(B encoding e$B$N4X78$Ge(B false e$B$K$J$k$3$H$,$”$k$N$Oe(B
e$B$=$&$$$&$b$N$G$7$g$&$+e(B?

e$B$=$&$$$&[email protected]$H$9$k$He(Bdumpe$B$NBe$o$j$Ke(Bencodinge$B$b4^$a$Fe(B
e$B85$KLa$;$k$h$&$K$9$k<jCJ$O2?$K$J$k$N$G$7$g$&$+e(B?

str = “\u3042”
eval(str.dump) == str #=> false

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

In message “Re: [ruby-dev:33142] eval(str.dump)==str”
on Thu, 17 Jan 2008 11:14:21 +0900, Kazuhiro NISHIYAMA
[email protected] writes:

|1.8 [email protected]$He(B eval(str.dump) == str e$B$,e(B true e$B$K$J$j$^$9$,!“e(B
|1.9 [email protected]$He(B encoding e$B$N4X78$Ge(B false e$B$K$J$k$3$H$,$”$k$N$Oe(B
|e$B$=$&$$$&$b$N$G$7$g$&$+e(B?

|str = “\u3042”
|eval(str.dump) == str #=> false

e$B$3$N%1!<%9$K$D$$$F$O%P%0$C$]$$$G$9!#e(Bevale$B$Oe(Bstring.encodinge$B$r8+e(B
e$B$F%9%/%j%W%H%(%s%3!<%G%#%s%0$r%;%C%[email protected]$C$?$N$G!"J8e(B
e$B;zNs$N%(%s%3!<%G%#%s%0$Oe(BUTF-8e$B$K$J$k$O$:$G$9!#;~4V$r8+$FD>$7e(B
e$B$F$*$-$^$9!#C/$+$,@h$KD>$7$F$/$l$F$b$$$$$1$I!#e(B

|e$B$=$&$$$&[email protected]$H$9$k$He(Bdumpe$B$NBe$o$j$Ke(Bencodinge$B$b4^$a$Fe(B
|e$B85$KLa$;$k$h$&$K$9$k<jCJ$O2?$K$J$k$N$G$7$g$&$+e(B?

e$B$=$l0J30$N%1!<%[email protected]<(E*$K;XDj$9$kI,MW$,$"$l$P9M$($^$9!#e(B

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

At Thu, 17 Jan 2008 11:47:27 +0900,
Yukihiro M. wrote:

|str = “\u3042”
|eval(str.dump) == str #=> false

e$B$3$N%1!<%9$K$D$$$F$O%P%0$C$]$$$G$9!#e(Bevale$B$Oe(Bstring.encodinge$B$r8+e(B
e$B$F%9%/%j%W%H%(%s%3!<%G%#%s%0$r%;%C%[email protected]$C$?$N$G!"J8e(B
e$B;zNs$N%(%s%3!<%G%#%s%0$Oe(BUTF-8e$B$K$J$k$O$:$G$9!#;~4V$r8+$FD>$7e(B
e$B$F$*$-$^$9!#C/$+$,@h$KD>$7$F$/$l$F$b$$$$$1$I!#e(B

e$B$=$&$$$&;EMM$J$i!"e(Bdumpe$B$GJV$C$F$/$kJ8;zNs$,e(BASCII-8BITe$B$Ke(B
e$B$J$C$F$$$k$N$G!"e(Bevale$B$NLdBj$G$O$J$5$=$&$G$9!#e(B

dumpe$B$NJ}$O!"e(Bdumpe$B$GJV$C$F$/$kJ8;zNs$,e(Bdumpe$BA0$HF1$8e(Bencodinge$B$Ke(B
e$B$J$C$F$b!"e(Bascii [email protected]$+$iLdBj$J$5$=$&$J5$$,$7$^$9!#e(B

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

In message “Re: [ruby-dev:33145] Re: eval(str.dump)==str”
on Thu, 17 Jan 2008 12:05:28 +0900, Kazuhiro NISHIYAMA
[email protected] writes:

|e$B$=$&$$$&;EMM$J$i!"e(Bdumpe$B$GJV$C$F$/$kJ8;zNs$,e(BASCII-8BITe$B$Ke(B
|e$B$J$C$F$$$k$N$G!"e(Bevale$B$NLdBj$G$O$J$5$=$&$G$9!#e(B

e$B$=$&$G$9$M!#:rF|!"6u9A$GHt9T5!$rBT$C$F$k;~$K5$$,$D$-$^$7$?!#e(B

|dumpe$B$NJ}$O!"e(Bdumpe$B$GJV$C$F$/$kJ8;zNs$,e(Bdumpe$BA0$HF1$8e(Bencodinge$B$Ke(B
|e$B$J$C$F$b!"e(Bascii [email protected]$+$iLdBj$J$5$=$&$J5$$,$7$^$9!#e(B

e$BLdBj$O85$N%(%s%3!<%G%#%s%0$,e(BASCIIe$B%3%s%Q%A$G$J$$>l9ge(B(UTF-16e$B$He(B
e$B$+e(B)e$B$G$9$M!#$G!"$A$g$C$H$R$I$$$G$9$,!“e(Basciicompate$B$G$J$$>l9g$Ke(B
e$B$Oe(Bdumpe$BJ8;zNs$NKvHx$K!Ve(B.force_encoding(“UTF-16BE”)e$B!W$r$D$1$k$3e(B
e$B$H$K$7$^$7$?!#e(BUTF-16e$B$r;H$&?M$,$?$/$5$s=P$F$-$F!”$3$N=9$$2sHre(B
e$B:v$K5$$,$D$/?M$,A}$($k$^$G$K$O$J$s$+JL$N<j$r9M$($h$&$H;W$$$^e(B
e$B$9!#e(Bdumpe$BJ8;zNs$N%$%s%9%?%s%9JQ?t$KJ]B8$9$k$+$J$"!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(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