GNU bug report logs - #12008
Alphabetic sorting respect user's language and/or locale

Previous Next

Package: emacs;

Reported by: martin rudalics <rudalics <at> gmx.at>

Date: Sat, 21 Jul 2012 14:39:02 UTC

Severity: wishlist

Merged with 2263

Fixed in version 25.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 12008 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 12008 <at> debbugs.gnu.org
Subject: Re: bug#12008: Alphabetic sorting respect user's language and/or
	locale
Date: Sat, 21 Jul 2012 19:01:11 +0300
> Date: Sat, 21 Jul 2012 16:32:50 +0200
> From: martin rudalics <rudalics <at> gmx.at>
> 
> Currently, specifying alphabetic order for output produced by functions
> like `dired' and `sort-subr' makes that output appear in ASCII-code
> order.  This means that such output deviates from the order expected by
> users of Latin-derived alphabets like French, German or Spanish and
> can make working with these functions very awkward.
> 
> Please consider adding a predicate which makes it possible to produce
> such output in alphabetic order respecting the language and/or locale
> of the user.

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));

However, there are 2 potential issues with this:

 . do typical libc implementations of strcoll handle multibyte
   characters correctly, if ENCODE_SYSTEM happens to produce multibyte
   encoding, such as UTF-8?

 . is the above efficient enough, when ENCODE_SYSTEM is not a no-op
   (which it is for UTF-8 locales)?

I don't know the answer to these, mainly to the first.  (The
MS-Windows implementation is claimed to handle multibyte strings.)
Anyone?




This bug report was last modified 10 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.