Subject: bug#51292: 27.2; Reversing strings with unicode combining characters

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 20 Oct 2021 10:58:50 +0200

Howard Melman <[email-masked]> writes:

>> But it might make sense to add function to tokenize a string into
>> grapheme clusters -- I can see that being useful.  Then the caller can
>> chop and reverse the list of clusters as they wish.
>>
>> `string-tokenize-graphemes'?
>
> I agree that seems potentially useful.

It's not that common to have un-normalised strings, though, and if you
normalise the string first you get

(reverse (ucs-normalize-NFC-string "nai\u0308ve"))
=> "evïan"

as expected.  So I think adding more utility functions here wouldn't be
productive (i.e., I don't think they would actually be useful for
people -- they'd just complicate things for users further).

So I think everything here is basically working as designed in Emacs,
and that the design is fine.  (And that the s-reverse isn't good.)  So
I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no