diff options
Diffstat (limited to 'tools/voice.pl')
-rwxr-xr-x | tools/voice.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/voice.pl b/tools/voice.pl index 8e0a7f0152..edec07194c 100755 --- a/tools/voice.pl +++ b/tools/voice.pl | |||
@@ -25,6 +25,7 @@ use IPC::Open2; | |||
25 | use IPC::Open3; | 25 | use IPC::Open3; |
26 | use Digest::MD5 qw(md5_hex); | 26 | use Digest::MD5 qw(md5_hex); |
27 | use DirHandle; | 27 | use DirHandle; |
28 | use open IN => ':utf8'; | ||
28 | 29 | ||
29 | sub printusage { | 30 | sub printusage { |
30 | print <<USAGE | 31 | print <<USAGE |
@@ -90,6 +91,8 @@ sub init_tts { | |||
90 | $cmd =~ s/\\/\\\\/g; | 91 | $cmd =~ s/\\/\\\\/g; |
91 | print("> cscript //nologo $cmd\n") if $verbose; | 92 | print("> cscript //nologo $cmd\n") if $verbose; |
92 | my $pid = open2(*CMD_OUT, *CMD_IN, "cscript //nologo $cmd"); | 93 | my $pid = open2(*CMD_OUT, *CMD_IN, "cscript //nologo $cmd"); |
94 | binmode(*CMD_IN, ':encoding(utf16le)'); | ||
95 | binmode(*CMD_OUT, ':encoding(utf16le)'); | ||
93 | $SIG{INT} = sub { print(CMD_IN "QUIT\r\n"); panic_cleanup(); }; | 96 | $SIG{INT} = sub { print(CMD_IN "QUIT\r\n"); panic_cleanup(); }; |
94 | $SIG{KILL} = sub { print(CMD_IN "QUIT\r\n"); panic_cleanup(); }; | 97 | $SIG{KILL} = sub { print(CMD_IN "QUIT\r\n"); panic_cleanup(); }; |
95 | print(CMD_IN "QUERY\tVENDOR\r\n"); | 98 | print(CMD_IN "QUERY\tVENDOR\r\n"); |
@@ -330,7 +333,7 @@ sub generateclips { | |||
330 | my $voice = ''; | 333 | my $voice = ''; |
331 | my $cmd = "genlang -o -t=$target -e=$english $langfile 2>/dev/null"; | 334 | my $cmd = "genlang -o -t=$target -e=$english $langfile 2>/dev/null"; |
332 | my $pool_file; | 335 | my $pool_file; |
333 | open(VOICEFONTIDS, "> voicefontids"); | 336 | open(VOICEFONTIDS, ">:utf8", "voicefontids"); |
334 | my $i = 0; | 337 | my $i = 0; |
335 | local $| = 1; # make progress indicator work reliably | 338 | local $| = 1; # make progress indicator work reliably |
336 | 339 | ||