Bug 10068

Summary: Move from the utf8:: pragma methods to Encode::
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Galen Charlton <gmcharlt>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P5 - low CC: m.de.rooy
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6554
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 10068 - Replace the utf8 pragma at acqui/booksellers.pl
Bug 10068 - Replace the utf8 pragma at C4/Output.pm
Bug 10068 - Replace the utf8 pragma at admin/preferences.pl
Bug 10068 - Replace the utf8 pragma at C4/Biblio.pm
Bug 10068 - Replace the utf8 pragma at acqui/histsearch.pl
Bug 10068 - Replace the utf8 pragma at C4/Installer.pm
Bug 10068 - Replace the utf8 pragma at C4/Search.pm

Description Tomás Cohen Arazi (tcohen) 2013-04-16 17:36:06 UTC
As stated by Larry Wall [1] we should not be using the loose (UTF-8 implementation) utf8::encode utf8::decode methods, and using Encode::encode and  Encode::decode (respectively) instead, which are stricter.

At first sight this might have important consequences (breakage for people having bad data). I belive it won't: we currently have reports on the lists of people having trouble with wide characters and bad encodings on the lists. (I think) several libs, we rely on, use UTF-8 instead of utf8. And we are not catching encoding problems properly because of the mixture.

To+

[1] http://perldoc.perl.org/Encode.html#UTF-8-vs.-utf8-vs.-UTF8
Comment 1 Tomás Cohen Arazi (tcohen) 2013-04-17 13:52:01 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi (tcohen) 2013-04-17 13:52:13 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi (tcohen) 2013-04-17 13:52:21 UTC
Created attachment 17503 [details] [review]
Bug 10068 - Replace the utf8 pragma at admin/preferences.pl

utf8::decode($string) for Encode::decode('UTF-8',$string)

Added Carp and error handling.

Sponsored-by: Universidad Nacional de Córdoba
Comment 4 Tomás Cohen Arazi (tcohen) 2013-04-17 13:52:33 UTC
Created attachment 17504 [details] [review]
Bug 10068 - Replace the utf8 pragma at C4/Biblio.pm

utf8::decode($string) for Encode::decode('UTF-8',$string)

Added Carp and error handling.

Sponsored-by: Universidad Nacional de Córdoba
Comment 5 Tomás Cohen Arazi (tcohen) 2013-04-17 13:52:42 UTC
Created attachment 17505 [details] [review]
Bug 10068 - Replace the utf8 pragma at acqui/histsearch.pl

utf8::decode($string) for Encode::decode('UTF-8',$string)

Added Carp and error handling.

Sponsored-by: Universidad Nacional de Córdoba
Comment 6 Tomás Cohen Arazi (tcohen) 2013-04-17 13:52:55 UTC
Created attachment 17506 [details] [review]
Bug 10068 - Replace the utf8 pragma at C4/Installer.pm

utf8::encode($string) for Encode::encode('UTF-8',$string)

Added Carp and error handling.

Sponsored-by: Universidad Nacional de Córdoba
Comment 7 Tomás Cohen Arazi (tcohen) 2013-04-17 13:53:05 UTC
Created attachment 17507 [details] [review]
Bug 10068 - Replace the utf8 pragma at C4/Search.pm

utf8::decode($string) for Encode::decode('UTF-8',$string)

Added Carp and error handling.

Sponsored-by: Universidad Nacional de Córdoba
Comment 8 Tomás Cohen Arazi (tcohen) 2014-07-02 19:07:28 UTC

*** This bug has been marked as a duplicate of bug 11944 ***