Hi,
In message "Re: [ruby-core:20545] Re: 1.9 character encoding (was: encoding of symbols)"
on Sun, 14 Dec 2008 16:11:29 +0900, "Michael Selig" <michael.selig / fs.com.au> writes:
|- it does a byte-by-byte comparison. Assuming the strings are different,
|Ruby returns what you would expect based on this.
|- if the strings are byte for byte identical, but they have incompatible
|encodings and at least one of the strings contains a non-ASCII character,
|then it seems that the result is determined by the ordering of the
|encodings, based on ruby's "encoding index" - an internal ordering of the
|available encodings. Maybe I have got this wrong - it doesn't make a lot
|of sense to me!
You're right. When we have two strings with identical byte sequence
but different encodings, we have to tell they are different. The
comparison result does not matter much, so I used encoding index.
Is there any alternative choice that makes sense?
matz.