From 98a22d4276caff13b7a4b0ff24f71bd5d29e1b7c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 7 Aug 2008 20:00:32 +0000 Subject: Fix SAPI voice file generation on multibyte windows variants (japanese, probably others, see FS #9246). This gets rid of the conversion in the VBScript (which relied on unsafe assumptions about charset conversion in windows), and lets PerlIO do the work instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18213 a1c6a512-1295-4272-9138-f99709370657 --- tools/voice.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/voice.pl') 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; use IPC::Open3; use Digest::MD5 qw(md5_hex); use DirHandle; +use open IN => ':utf8'; sub printusage { print < cscript //nologo $cmd\n") if $verbose; my $pid = open2(*CMD_OUT, *CMD_IN, "cscript //nologo $cmd"); + binmode(*CMD_IN, ':encoding(utf16le)'); + binmode(*CMD_OUT, ':encoding(utf16le)'); $SIG{INT} = sub { print(CMD_IN "QUIT\r\n"); panic_cleanup(); }; $SIG{KILL} = sub { print(CMD_IN "QUIT\r\n"); panic_cleanup(); }; print(CMD_IN "QUERY\tVENDOR\r\n"); @@ -330,7 +333,7 @@ sub generateclips { my $voice = ''; my $cmd = "genlang -o -t=$target -e=$english $langfile 2>/dev/null"; my $pool_file; - open(VOICEFONTIDS, "> voicefontids"); + open(VOICEFONTIDS, ">:utf8", "voicefontids"); my $i = 0; local $| = 1; # make progress indicator work reliably -- cgit v1.2.3