voice: Normalize all voiced strings NFC form before passing them to TTS engine

This should be a no-op for .lang files, but it can matter when
generating talk clips, as those are based on the raw filename.

Change-Id: Ia449ae7668818e4bf093347fd0fb15fa5b67fa69
This commit is contained in:
Solomon Peachy 2024-10-13 09:14:25 -04:00
parent d98cad4301
commit 9420650c87

View file

@ -29,6 +29,7 @@ use DirHandle;
use open ':encoding(utf8)'; use open ':encoding(utf8)';
use Encode::Locale; use Encode::Locale;
use Encode; use Encode;
use Unicode::Normalize;
sub printusage { sub printusage {
print <<USAGE print <<USAGE
@ -281,6 +282,9 @@ sub voicestring {
$tts_engine_opts .= $$tts_object{"ttsoptions"}; $tts_engine_opts .= $$tts_object{"ttsoptions"};
# Normalize Unicode
$string = NFC($string);
printf("Generate \"%s\" with %s in file %s\n", $string, $name, $output) if $verbose; printf("Generate \"%s\" with %s in file %s\n", $string, $name, $output) if $verbose;
if ($name eq 'festival') { if ($name eq 'festival') {
# festival_client lies to us, so we have to do awful soul-eating # festival_client lies to us, so we have to do awful soul-eating