Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: A UTF8 round trip with MySQL

by Joost (Canon)
on Jun 28, 2007 at 18:01 UTC ( [id://623958]=note: print w/replies, xml ) Need Help??


in reply to Re: A UTF8 round trip with MySQL
in thread A UTF8 round trip with MySQL

decode_utf8 will fail when $data is already flagged as utf8 (i.e. when you're using mysql_enable_utf8 on a recent DBD::mysql version).

Also, as clinton noted, your code also requires you to keep track of which columns are binary and which are text.

Replies are listed 'Best First'.
Re^3: A UTF8 round trip with MySQL
by Burak (Chaplain) on Jun 28, 2007 at 21:26 UTC
    mysql_enable_utf8 is not an auto feature, so it has no effect unless enabled. If it is in effect and I also use Encode methods, this is like shooting yourself in the foot :)
Re^3: A UTF8 round trip with MySQL
by Anonymous Monk on Jul 30, 2013 at 13:30 UTC
    decode_utf8 will only fail if the input is invalid utf-8. whether the data is flagged as utf-8 or not does not matter.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-25 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found