summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-05-07 15:13:33 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-05-07 16:21:21 -0400
commit64e4f81ffc7173bfbbf83bb4485a29ede67a4824 (patch)
tree65ebc91f2eb2a325a24c68ce52f6aab2fadfa461
parent3348d8420663420fb46bc6d11e41703aa716af31 (diff)
downloadrockbox-64e4f81ffc7173bfbbf83bb4485a29ede67a4824.tar.gz
rockbox-64e4f81ffc7173bfbbf83bb4485a29ede67a4824.zip
voice: Properly handle UTF8-encoded filenames when generating talkclips
Eg this was happening before: '11 - Breña.mp3' --> '11 - Breña.mp3' As well as resulting in incorrect voicing, it was breaking the encoding of the .wav to .talk. Change-Id: I6cf844d843ddf1a459f92e1ebd55c9feec886f55
-rwxr-xr-xtools/voice.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/voice.pl b/tools/voice.pl
index 337407e187..2c966cb0df 100755
--- a/tools/voice.pl
+++ b/tools/voice.pl
@@ -17,6 +17,7 @@
17 17
18use strict; 18use strict;
19use warnings; 19use warnings;
20use utf8;
20use File::Basename; 21use File::Basename;
21use File::Copy; 22use File::Copy;
22use vars qw($V $C $t $l $e $E $s $S $i $v $f $F); 23use vars qw($V $C $t $l $e $E $s $S $i $v $f $F);
@@ -25,8 +26,8 @@ use IPC::Open3;
25use Digest::MD5 qw(md5_hex); 26use Digest::MD5 qw(md5_hex);
26use DirHandle; 27use DirHandle;
27use open ':encoding(utf8)'; 28use open ':encoding(utf8)';
28use open ':std'; 29use Encode::Locale;
29use utf8; 30use Encode;
30 31
31sub printusage { 32sub printusage {
32 print <<USAGE 33 print <<USAGE
@@ -562,6 +563,7 @@ sub gentalkclips {
562 my ($dir, $tts_object, $encoder, $encoder_opts, $tts_engine_opts, $i) = @_; 563 my ($dir, $tts_object, $encoder, $encoder_opts, $tts_engine_opts, $i) = @_;
563 my $d = new DirHandle $dir; 564 my $d = new DirHandle $dir;
564 while (my $file = $d->read) { 565 while (my $file = $d->read) {
566 $file = Encode::decode( locale_fs => $file);
565 my ($voice, $wav, $enc); 567 my ($voice, $wav, $enc);
566 my $format = $tts_object->{'format'}; 568 my $format = $tts_object->{'format'};
567 569