Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

genlang: Explicitly decompose all display strings

We already have pretty solid support for glyph combining, so this will
allow us to utilize that to fill in gaps of our font coverage. This is
most notable for Vietnamese, Turkish, and numerous other latin-based
writing systems that have unique glyphs that are essentially just a
"standard" ascii letter plus a diacritic mark.

This leaves *voice* strings fully composed/normalized.

It also has no effect on user-supplied strings (eg filenames or file
metadata)

When we eventually utf8proc merged, this can be removed in favor
of always doing the [de]composition in-system. We will also need
to revisit our diacritic tables to ensure there's nothing missing.

Change-Id: I7012d27010bb33fb0b565ac7dfd57a16bdcad34f

+10 -3
+10 -3
tools/genlang
··· 9 9 # 10 10 # Copyright (C) 2006 - 2008 by Daniel Stenberg 11 11 # 12 + use utf8; 13 + use Unicode::Normalize; 14 + use Encode qw( encode_utf8 ); 12 15 13 16 # See apps/language.c (TODO: Use common include for both) 14 17 # Cookie and binary version for the binary lang file ··· 322 325 # 323 326 324 327 open(LANG, "<$input") || die "Error: couldn't read language file named $input\n"; 328 + binmode(LANG, ":utf8"); 329 + 325 330 my @phrase; 326 331 my $langoptions = 0; 327 332 ··· 610 615 $langoptions); # magic lang file header 611 616 } 612 617 if($binvoice) { 613 - open(OUTV, ">$binvoice") or die "Error: Can't create $binary"; 618 + open(OUTV, ">$binvoice") or die "Error: Can't create $binvoice"; 614 619 binmode OUTV; 615 620 printf OUTV ("%c%c%c%c", $VOICE_COOKIE, $LANGUAGE_VERSION, $target_id, 616 621 $langoptions); # magic lang file header ··· 646 651 647 652 if($dest && $n < 0x8000 && $binary) { 648 653 $dest =~ s/^\"(.*)\"\s*$/$1/g; # cut off quotes 654 + $dest = encode_utf8(NFD($dest)); # Decompose 649 655 650 656 # Now, make sure we get the number from the english sort order: 651 657 $idnum = $idmap[$_]{$name}; 652 658 653 - printf OUTF ("%c%c%s\x00", ($idnum>>8), ($idnum&0xff), $dest); 659 + printf OUTF ("%c%c%s\x00", (($idnum>>8)&0xff), ($idnum&0xff), $dest); 654 660 } 655 661 if($voice && $binvoice) { 656 662 $voice =~ s/^\"(.*)\"\s*$/$1/g; # cut off quotes 663 + $voice = encode_utf8($voice); 657 664 # Now, make sure we get the number from the english sort order: 658 665 $idnum = $idmap[$_]{$name}; 659 - printf OUTV ("%c%c%s\x00", ($idnum>>8), ($idnum&0xff), $voice); 666 + printf OUTV ("%c%c%s\x00", (($idnum>>8)&0xff), ($idnum&0xff), $voice); 660 667 } 661 668 } 662 669 }