Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot decode string with wide characters

6 views
Skip to first unread message

Bill Moseley

unread,
Dec 5, 2013, 12:10:02 AM12/5/13
to perl-u...@perl.org
"Cannot decode string with wide characters"

I see this error when calling decode_utf8() on a character string (with wide characters) that was already decoded.

This error started with Encode 2.53, it seems.  Previous versions appear to ignore the double decoding.   I assume that means the decode was a noop if the UTF8 flag was already on.

I'm curious about the change.  Was there a problem with the old behavior, or was the change to make it more strict?   Or some other problem caused by double decoding?

I agree that it would be good to be told when double-decoding.

But, I have a situation with a legacy app where decode_utf8 was sprinkled all over the app because the database DBD was not configured to turn on the UTF8 flag (pg_enable_utf8).   Turning it on now would be the right approach and solve some existing encoding issues, but the newer Encode breaks because of all the existing decode_utf8 calls.


The joys of legacy apps:

$ fgrep  -r 'decode_utf8(' . | wc -l
456

--
Bill Moseley
mos...@hank.org
0 new messages