Copilot
Your everyday AI companion
About 150,000 results
    Upvotes14edited Oct 1, 2013 at 17:47

    encode takes a string of Unicode code points and serialises them into a string of bytes.

    decode takes a string of bytes and deserialises them into Unicode code points.

    That message means you passed a string containing one or more characters above 255 (non-bytes) to decode, which is obviously an incorrect argument.

    >perl -MEncode -E"for (254..257) { say; decode('iso-8859-1', chr($_)); }"
    254
    255
    256
    Wide character in subroutine entry at .../Encode.pm line 176.

    You ask for a workaround, but the bug is yours. Perhaps you are accidentally trying to decode...

    Content Under CC-BY-SA license
    Was this helpful?
  1. Feedback
  2. "Cannot decode string with wide characters" appears on a weird …

  3. Cannot decode string with wide characters #74 - GitHub

  4. Cannot decode string with wide charactersCannot decode string …

  5. Perl Programming/Unicode UTF-8 - Wikibooks

  6. Perl – “Cannot decode string with wide characters” appears on a …

  7. perlunifaq - Perl Unicode FAQ - Perldoc Browser

  8. SFX; diacritics: "Cannot decode string with wide characters at ...

  9. "Cannot decode string with wide characters" error may occur when ...

  10. Mastering Unicode in Modern C++: A Comprehensive Guide to Wide

  11. Some results have been removed