Bugzilla – Attachment 96896 Details for
Bug 24365
Using strict from TmplTokenizer.pm broke the translator script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24365: (bug 24217 follow-up) Fix encoding issue for translator script
Bug-24365-bug-24217-follow-up-Fix-encoding-issue-f.patch (text/plain), 1.56 KB, created by
Jonathan Druart
on 2020-01-07 14:54:15 UTC
(
hide
)
Description:
Bug 24365: (bug 24217 follow-up) Fix encoding issue for translator script
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-07 14:54:15 UTC
Size:
1.56 KB
patch
obsolete
>From 94a162c34cfeca6228be53a37f954080a226cf94 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 7 Jan 2020 15:47:14 +0100 >Subject: [PATCH] Bug 24365: (bug 24217 follow-up) Fix encoding issue for > translator script >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >I am not sure what happened here, but adding strict for TmplTokenizer.pm >breaks a test for translation. > >It has been caught by a failing test: > % prove xt/author/translatable-templates.t >will display lines "invalid multibyte sequence" > >I did a diff between the generated files and found: >< msgid "Ã rbok" >--- >> msgid "Ãrbok" > >Which made me think of an encoding issue. >Specifying the encoding when write open the file fixes the problem. > >Test plan: > % prove xt/author/translatable-templates.t >must return green >--- > misc/translator/xgettext.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl >index 8890d4252b..f7b42e589a 100755 >--- a/misc/translator/xgettext.pl >+++ b/misc/translator/xgettext.pl >@@ -366,7 +366,7 @@ usage_error('You cannot specify both --convert-from and --files-from') > > if (defined $output && $output ne '-') { > print STDERR "$0: Opening output file \"$output\"\n" if $verbose_p; >- open($OUTPUT, '>', $output) || die "$output: $!\n"; >+ open($OUTPUT, '>:encoding(utf-8)', $output) || die "$output: $!\n"; > } else { > print STDERR "$0: Outputting to STDOUT...\n" if $verbose_p; > open($OUTPUT, ">&STDOUT"); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24365
: 96896