all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: string-collate-lessp in elisp
Date: Sun, 21 Jul 2024 09:35:56 +0300	[thread overview]
Message-ID: <86ed7nckvn.fsf@gnu.org> (raw)
In-Reply-To: <m37cdfb6wy.fsf@leonis4.robolove.meer.net> (message from Madhu on Sun, 21 Jul 2024 11:52:53 +0530)

> From: Madhu <enometh@meer.net>
> Date: Sun, 21 Jul 2024 11:52:53 +0530
> 
> 
> I can sort lines with "accents" by calling STRING-COLLATE-LESSP with an
> optional "en_US.UTF-8" LOCALE parameter. But would it be possible to
> implement the string comparison function in emacs directly using the
> unicode data that emacs already has?

Emacs doesn't import the Unicode collation data, only the codepoints.
string-lessp and friends are based on that, and they compare strings
by codepoints only.  compare-strings does the same, but it also uses
the case-conversion tables (which Emacs does have, partly from
Unicode, partly from its own code).

The collation data is very large, and in addition depends (in minor,
but significant, ways) on the language and country.

> If someone has a pointer to the collation rules that have to be
> implemented and maybe prior work, I'd appreciate it.  -- Thanks, Madhu

The rules are described in this Unicode Technical Standard (UTS#10):

  https://www.unicode.org/reports/tr10/



      reply	other threads:[~2024-07-21  6:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21  6:22 string-collate-lessp in elisp Madhu
2024-07-21  6:35 ` Eli Zaretskii [this message]

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=86ed7nckvn.fsf@gnu.org \
    --to=eliz@gnu.org \
    --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.