Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Catalyst: Wide character outside byte range in response. Encoding data as UTF-8

by sundialsvc4 (Abbot)
on Dec 31, 2014 at 17:00 UTC ( [id://1111848]=note: print w/replies, xml ) Need Help??


in reply to Catalyst: Wide character outside byte range in response. Encoding data as UTF-8

If you called decode() on $content before passing it to the template, then, yes, you would “cause the message to go away.”   But you have altered the content possibly in a destructive way as-seen by a Chinese user (but perhaps, not as-seen by non-Chinese you).

What you probably want to do is to explicitly encode() the string before passing it to the template, thereby relieving the ever-vigilant Catalyst from having to do this for you.   If the string contains no UTF characters, encoding will do nothing to the content.   If it does, it will do the right thing to it.

decoding would be applied to incoming data, not outgoing data.   (And if I have this backwards, you’ll see my mistake being pointed-out by snarky replies and downvotes within a matter of minutes if not seconds ...)

I am not familiar with that plug-in, but what I would do is to look at the source-code of it.   (Who knows, maybe that plug-in is what is actually producing the message?)   Anyhow, I prefer not to rely upon plug-ins to do such things.   I prefer to have full and conscious control of when and how every encoding/decoding step is done, because plug-ins necessarily have to “guess.”

Replies are listed 'Best First'.
Re^2: Catalyst: Wide character outside byte range in response. Encoding data as UTF-8
by botongdage (Initiate) on Dec 31, 2014 at 20:59 UTC
    In order to handle unicode issues, many things need to be checked and enabled. If there is one flag to turn on utf8, that would be very nice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1111848]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-26 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found