all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Alternative to string< that works "well" with unicode
Date: Fri, 28 Nov 2014 00:52:31 +0100	[thread overview]
Message-ID: <87egsourpc.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: mailman.14831.1417128158.1147.help-gnu-emacs@gnu.org

Rasmus <rasmus@gmx.us> writes:

> Hi,
>
> I want to sort a list of strings, including accented strings, in a
> "meaningful way".  E.g. with this list (É E T A À Z) the sorted list
> should be (A À E É T Z).
>
> (sort '(É E T A À Z) 'string<)
>       => (A E T Z À É) ; expected (A À E É T Z)

You might have expected that, but users writing different languages will
have expected something else.

This is called localization.


> I tried all the versions of 'string< that I could find with apropos.
>
> Is there a function that will support my preferred sorting in Emacs?

AFAICS, there's nothing yet.

http://en.wikipedia.org/wiki/Unicode_collation_algorithm

You could try to implement the UCA (Unicode Collation Algorithm):
http://www.unicode.org/reports/tr10/

Alternatively, you could send the data to the unix sort command, with
the right LC_ALL environment variable.

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


       reply	other threads:[~2014-11-27 23:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.14831.1417128158.1147.help-gnu-emacs@gnu.org>
2014-11-27 23:52 ` Pascal J. Bourguignon [this message]
2014-11-28  0:06   ` Alternative to string< that works "well" with unicode Yuri Khan
2014-11-28  0:32     ` Rasmus
2014-11-28  8:25       ` Eli Zaretskii
2014-11-28  8:43         ` Rasmus
2014-11-27 22:42 Rasmus

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

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

  git send-email \
    --in-reply-to=87egsourpc.fsf@kuiper.lan.informatimago.com \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.