[Koha-bugs] [Bug 21848] Handle encoding when calling Text::Unaccent::unac_string

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Nov 16 09:45:00 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21848

--- Comment #1 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 82384
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82384&action=edit
Bug 21848: Handle encoding when calling Text::Unaccent::unac_string

Resolve warnings like:
    unac_string: Invalid or incomplete multibyte or wide character

Note that Text::Unaccent says:
    Return the unaccented equivalent of the string $string. The character set
of $string is specified by the $charset argument. The returned string is coded
using the same character set.

The only place we call unac_string is: Koha::Patron->generate_userid:
    $userid = unac_string('utf-8',$userid);
Since we say to unac_string that $userid is utf-8, we should first encode it
and the result we should decode again for further handling.

Test plan:
[1] Run t/db_dependent/Koha/Patrons.t
[2] Run t/db_dependent/Circulation.t (before this patch it gave a few warns)

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list