Unicode sorting

Dar Scott dsc at swcp.com
Fri May 26 19:26:10 EDT 2006


On May 26, 2006, at 3:57 PM, Devin Asay wrote:

> A 'sort lines' command, after converting upper case to lower, works  
> fairly well, except that, curiously, a space sorts *after* all  
> cyrillic chars.


I think I figured out what it is.  'sort' seems to see NUL as the end  
of the string and U+0020 has virtually a NUL in it.  Try this test:

on mouseUp
   put "a" & NULL & "z" & lf & "a" & NULL & "b" into d
   sort d
   replace NULL with "x" in d
   put d
end mouseUp
==>
axz
axb

We have been bitten by C again.

Dar



More information about the Use-livecode mailing list