unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: 12008@debbugs.gnu.org
Subject: bug#12008: Alphabetic sorting respect user's language and/or locale
Date: Sat, 21 Jul 2012 19:01:11 +0300	[thread overview]
Message-ID: <83liid14u0.fsf@gnu.org> (raw)
In-Reply-To: <500ABD92.5050104@gmx.at>

> Date: Sat, 21 Jul 2012 16:32:50 +0200
> From: martin rudalics <rudalics@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?





  reply	other threads:[~2012-07-21 16:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-21 14:32 bug#12008: Alphabetic sorting respect user's language and/or locale martin rudalics
2012-07-21 16:01 ` Eli Zaretskii [this message]
2012-07-21 16:38   ` Eli Zaretskii
2012-07-22 10:24   ` Stefan Monnier
2012-07-22 15:25     ` Eli Zaretskii
2012-07-23  8:57       ` Stefan Monnier
2012-07-23 15:34         ` Eli Zaretskii
2012-07-23 23:30           ` Stefan Monnier
2012-07-23  9:34       ` martin rudalics
2012-07-23 15:38         ` Eli Zaretskii
2012-07-23 15:49           ` martin rudalics
2012-07-23 15:55             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83liid14u0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=12008@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).