| [reply] |
As moritz pointed out above, the issue is not 32- vs, 64-bit cpu, but rather the OS and/or perl version and/or locale setup and/or how perl was built on each machine and/or the nature of the data in your "production" vs. "other" environments, etc. (If the actual source code file happens to differ in the production vs. other environments, well, such differences are obviously of interest...)
A quick-and-dirty work-around to make the two environments behave the same way is to make your utf8::decode($string) call conditional on whether $string has it's "utf8 flag" set.
The involves the is_utf8 function, which is mentioned in the utf8 manual, which in turn refers you to the more detailed description in the Encode manual, under the section "Messing with Perl's Internals" (you should take note of the caveats mentioned in both manuals):
utf8::decode( $string ) unless ( utf8::is_utf8( $string ));
(update: fixed missing close-paren)
BTW, if, as suggested in the OP, you are actually passing a quoted string to utf8::decode(); this would be quite pointless and counter-productive if your source code has use utf8 in it, and the quoted string happens to actually be a utf8 string in the source code. | [reply] [d/l] [select] |
Character decoding is the process of taking bytes and returning the characters they represent. That error indicates you asked the function to decode something that wasn't bytes.
>perl -MEncode -we"decode('UTF-8', qq{\x{123}})"
Cannot decode string with wide characters at ...
Why your input isn't what you think it is, I don't know. You did not provide any information that would help answer that question. | [reply] [d/l] |