Subject: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function?

From: Eli Zaretskii <[email-masked]>
Date: Sun, 17 Aug 2014 20:55:09 +0300

> Date: Sun, 17 Aug 2014 19:38:36 +0300
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked], [email-masked]
> 
> > From: Michael Albinus <[email-masked]>
> > Cc: [email-masked],  [email-masked]
> > Date: Sat, 16 Aug 2014 23:52:16 +0200
> > 
> > Just being curious, I've taken g_utf8_collate from the glib for a
> > test. It doesn't work bad.
> 
> Are you sure this is implemented in Glib, not in the underlying libc
> (glibc in your case, I presume)?

Answering myself here: by reading the source of g_utf8_collate, it is
clear that the implementation is elsewhere.  In particular, in any
environment that defines __STDC_ISO_10646__ (as does glibc),
g_utf8_collate simply calls wcscoll, after converting the UTF-8
strings to wide-character strings.

So I think a better alternative would be to base the implementation of
this feature on the system libraries directly.  I think most modern
platforms have the necessary facilities.