Hi, On 12.03.19 10:43, Urs Liska wrote:
Am 12.03.19 um 01:14 schrieb Aaron Hill:On 2019-03-11 3:40 pm, David Kastrup wrote:Urs Liska <li...@openlilylib.org> writes: [...]Also, I should have been clear before. David's code should work for most cases. I was just being pedantic that /./ would not work if the input has combining characters. For instance, if you type U+0308 (Combining Diaeresis) after an 'a', you'll get an ä. But the simple regex would not treat that as a single grapheme. The result would be "T a ̈ s t".I did understand it that way, and it would not be an issue in the project I'm working on. There it's just some umlauts.
given that Aaron, my undisputed hero of Lily-UTFxy-workarounds, is active in this thread: I'm surprised to see no mention of his wonderful example of such a workaround from
https://lists.gnu.org/archive/html/lilypond-user/2018-10/msg00473.htmlIIRC, the essentials of the approach is to encode stuff as UTF-32 (more or less brute force), and handle individual characters as chunks of 4 consecutive bytes / 0..255-integers in a list. It's not the ultimate solution to all imaginable troubles with encodings, but should be good enough for almost every *practical* use case.
In his modified center-lyrics-ignoring-punctuation.ily from that thread, you'll find the two main utility functions as string->utf32 and utf32->string. I presume you could call string->utf32, slice in a '(0 0 0 32) after each 4 entries, convert back via utf32->string, et voilà.
HTH, Alex
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user