Bug 10068 - Move from the utf8:: pragma methods to Encode::
Summary: Move from the utf8:: pragma methods to Encode::
Status: RESOLVED DUPLICATE of bug 11944
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-16 17:36 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2014-07-02 19:07 UTC (History)
1 user (show)

See Also:
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 (1.39 KB, patch)
2013-04-17 13:52 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10068 - Replace the utf8 pragma at C4/Output.pm (1.13 KB, patch)
2013-04-17 13:52 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10068 - Replace the utf8 pragma at admin/preferences.pl (1.20 KB, patch)
2013-04-17 13:52 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10068 - Replace the utf8 pragma at C4/Biblio.pm (2.04 KB, patch)
2013-04-17 13:52 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10068 - Replace the utf8 pragma at acqui/histsearch.pl (2.23 KB, patch)
2013-04-17 13:52 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10068 - Replace the utf8 pragma at C4/Installer.pm (1.79 KB, patch)
2013-04-17 13:52 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10068 - Replace the utf8 pragma at C4/Search.pm (3.04 KB, patch)
2013-04-17 13:53 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 ***