String#== is not transitive

String#== e$B$,?d0\N’$rK~$?$7$F$$$J$$e(B (e$B$D$^$jF1CM4X78$G$J$$e(B)
e$B$Ne(B
e$B$O$h$m$7$/$J$$$s$8$c$J$$$G$7$g$&$+!#e(B

% ./ruby -ve ’
u = “\xe0\xa0\xa1”.force_encoding(“utf-8”)
e = “\xe0\xa0\xa1”.force_encoding(“euc-jp”)
s = “\xe0\xa0\xa1”.force_encoding(“sjis”)
p u == e
p e == s
p u == s

ruby 1.9.0 (2007-12-24 revision 0) [i686-linux]
true
true
false

u e$B$He(B e e$B$,F1$8$Ge(B e e$B$He(B s e$B$,F1$8$J$N$K!"e(Bu e$B$He(B
s e$B$,0[$J$k$H$$$&$Ne(B
e$B$Oe(B == e$B$KBP$9$k4|BT$KH?$7$^$9!#e(B

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

In message “Re: [ruby-dev:32693] String#== is not transitive”
on Mon, 24 Dec 2007 09:05:29 +0900, Tanaka A. [email protected]
writes:

|String#== e$B$,?d0\N’$rK~$?$7$F$$$J$$e(B (e$B$D$^$jF1CM4X78$G$J$$e(B) e$B$Ne(B
|e$B$O$h$m$7$/$J$$$s$8$c$J$$$G$7$g$&$+!#e(B

e$B$*$C$7$c$kDL$j$G$9!#D>$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