1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Solomon Peachy 2024-05-07 15:13:33 -04:00
parent 3348d84206
commit 64e4f81ffc

View file

@ -17,6 +17,7 @@
use strict;
use warnings;
use utf8;
use File::Basename;
use File::Copy;
use vars qw($V $C $t $l $e $E $s $S $i $v $f $F);
@ -25,8 +26,8 @@ use IPC::Open3;
use Digest::MD5 qw(md5_hex);
use DirHandle;
use open ':encoding(utf8)';
use open ':std';
use utf8;
use Encode::Locale;
use Encode;
sub printusage {
print <<USAGE
@ -562,6 +563,7 @@ sub gentalkclips {
my ($dir, $tts_object, $encoder, $encoder_opts, $tts_engine_opts, $i) = @_;
my $d = new DirHandle $dir;
while (my $file = $d->read) {
$file = Encode::decode( locale_fs => $file);
my ($voice, $wav, $enc);
my $format = $tts_object->{'format'};