* string-collate-lessp in elisp
@ 2024-07-21 6:22 Madhu
2024-07-21 6:35 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Madhu @ 2024-07-21 6:22 UTC (permalink / raw)
To: help-gnu-emacs
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?
If someone has a pointer to the collation rules that have to be
implemented and maybe prior work, I'd appreciate it. -- Thanks, Madhu
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: string-collate-lessp in elisp
2024-07-21 6:22 string-collate-lessp in elisp Madhu
@ 2024-07-21 6:35 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2024-07-21 6:35 UTC (permalink / raw)
To: help-gnu-emacs
> 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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-21 6:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-21 6:22 string-collate-lessp in elisp Madhu
2024-07-21 6:35 ` Eli Zaretskii
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).