Subject: Re: bug#12008: Alphabetic sorting respect user's language and/or locale

From: Stefan Monnier <[email-masked]>
Date: Sun, 22 Jul 2012 06:24:31 -0400

> A simple way of doing this goes along the following lines:
>   Lisp_Object enc_str1 = ENCODE_SYSTEM (string1);
>   Lisp_Object enc_str2 = ENCODE_SYSTEM (string2);
>   return make_number (strcoll (enc_str1, enc_str2));

That's probably OK for dired'd sorting but not for sort-subr where we
need to be independent from the system locale.  So better would be to
switch the locale to utf-8 and call strcoll without calling
ENCODE_SYSTEM (tho of course, only if the strings are multibyte).

        Stefan