[TxMt] sort files with non-latin characters

Freek Dijkstra public at macfreek.nl
Fri Aug 21 14:58:31 UTC 2009


I found a small bug. Since this is part of a bundle, the macromates
website asked me to report it here.

Summary: sort does not with euro symbol, and some other non-Latin

Steps to reproduce
1. Open new text file.
2. Add text with a EURO symbol, e.g.
aaa €
bbb ¥
ccc $
ddd £
3. sort the file with F5 (Text > Sorting > Sort lines in document)

I get the error:
sort: string comparison failed: Illegal byte sequence
sort: Set LC_ALL='C' to work around the problem.
sort: The strings compared were `AAA \302\202\254' and `BBB ¥'.

Most non-Latin characters work fine. Just this one fails. If I save the
file and simply run "sort test.txt" all is fine. Both in my shell and in
TextMate, "echo $LC_ALL" return "en_GB.UTF-8".

Typing the following script in TextMate and "run script" works fine:
echo "ccc\naaa€\nbbb" | sort

What would be different for the "Sort lines in document" (which simply
calls "sort") and the above script?

Any clue?
Is this reproducible by others?

Freek Dijkstra

More information about the textmate mailing list