So it doesn't even sort ASCII characters correctly?
If it does sort ASCII correctly, but not the rest, it could be that your input data is not in the same encoding as the script itself, and thus they don't match your non-ASCII-characters in your script.