Bugzilla – Attachment 103875 Details for
Bug 25305
Double UTF-8 encoding on translation files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25305: fix double encoding in translation files
Bug-25305-fix-double-encoding-in-translation-files.patch (text/plain), 2.04 KB, created by
Bernardo Gonzalez Kriegel
on 2020-04-28 18:09:44 UTC
(
hide
)
Description:
Bug 25305: fix double encoding in translation files
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2020-04-28 18:09:44 UTC
Size:
2.04 KB
patch
obsolete
>From 736d7a72e2504fcfbff2a2979a111a874df9883f Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Tue, 28 Apr 2020 14:42:56 -0300 >Subject: [PATCH] Bug 25305: fix double encoding in translation files > >Changes inroduced in Bug 24217 and Bug 24365 are >producing strings with double encoding > >Don't know exactly what is producing the problem, >but I propose a fix > >There are two changes, a feature limited use of >Modern::Perl and preventing double encoding in >output file. > >To test: >1) Create translation files for a new language >( cd misc/translator; ./translate create xx-YY) >2) Verify double encoding >egrep "Aix-Marseille|Jean Prunier|periodika|Bokm" misc/translator/po/xx-YY-* >check strange strings >3) Apply the patch >4) Create po files again >( cd misc/translator; rm -f po/xx-YY*; ./translate create xx-YY) >5) Verify no more double encoding >egrep "Aix-Marseille|Jean Prunier|periodika|Bokm" misc/translator/po/xx-YY-* >check normal strings >--- > misc/translator/TmplTokenizer.pm | 2 +- > misc/translator/xgettext.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm >index b092ba61d7..1edc9e0d4f 100644 >--- a/misc/translator/TmplTokenizer.pm >+++ b/misc/translator/TmplTokenizer.pm >@@ -1,6 +1,6 @@ > package TmplTokenizer; > >-use Modern::Perl; >+use Modern::Perl '2010'; > use C4::TmplTokenType; > use C4::TmplToken; > use C4::TTParser; >diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl >index 89e01eed5b..889baf64a7 100755 >--- a/misc/translator/xgettext.pl >+++ b/misc/translator/xgettext.pl >@@ -367,7 +367,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, '>:encoding(utf-8)', $output) || die "$output: $!\n"; >+ open($OUTPUT, '>', $output) || die "$output: $!\n"; > } else { > print STDERR "$0: Outputting to STDOUT...\n" if $verbose_p; > open($OUTPUT, ">&STDOUT"); >-- >2.17.1
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 25305
:
103875
|
103902
|
103906
|
103914
|
104185
|
104226