Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Handle UTF-8 with DBI

by Errto (Vicar)
on Jan 04, 2006 at 15:28 UTC ( [id://520938]=note: print w/replies, xml ) Need Help??


in reply to Handle UTF-8 with DBI

IIRC I had a similar problem which was fixed by upgrading to the latest version of DBD::mysql so you might want to make sure your provider is running that.

The empty string is coming because the default behavior of Encode is to silently drop any byte sequence it is not able to decode from the byte stream using the given character encoding (UTF-8 in this case). If you want you can instead have it die and give you the exact byte sequence it's trying to decode using the FB_CROAK option (see the Encode docs for more). If none of this works try taking a hex dump of the returned string using unpack and make sure it is correct UTF-8.

Last, you should make sure MySQL is using UTF-8 as the encoding for the given database or column.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found