From: David Vallner Date: 2006-01-12T06:59:41+09:00 Subject: Re: Ruby, Unicode - ever? Bruce D'Arcus wrote: >Levin Alexander wrote: > > >>On 1/11/06, Bruce D'Arcus wrote: >> >> >> >>>I''d like to be able to do this and have it just work: >>> >>>x = ["z", "a", "�", "o", "b"] >>>puts x.sort.inspect >>> >>> >>Correct sorting of text is a quite tricky problem, because the correct >>sort order will probably be language or application specific. >> >> >> >>>Maybe I'm missing something (and if I am, please tell me), but even >>>when using jcode, the multi-byte character always is last. >>> >>> >> >> >> > >Yes, I'm aware of that, but I'd rather have a default collation used >that gets very close, than for Ruby not even try to sort extended >characters. > >Indeed, this is how xpath/xslt 2.0 works; there's the required default >collation you cite above (which works fine for my use cases), and one >can plug-in alternate collations if needed. > >Bruce > > > > Hmm. Would a change to String#<=> to respect that document when $KCODE == 'u' break too much code? David Vallner