Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Can't write cyrillic to DBD::mysql

by Xilman (Hermit)
on Jun 29, 2010 at 10:28 UTC ( [id://847087] : note . print w/replies, xml ) Need Help??


in reply to Can't write cyrillic to DBD::mysql

I'm not sure what is going wrong, and my experience with a DB holding non-ASCII characters is with Postgres and with Greek characters. Accordingly I can't give you answers but can recommend a few things which may help you with your debugging.

What is the value of $sql when you execute the third command?

Are you absolutely certain it contains UTF8 encoded Cyrillic characters?

If you read a Cyrillic string from your DB and then write it back to another location, does it get corrupted?

Is it only Cyrillic which is giving problems, or do other characters outside code page zero? (My guess is that they won't work either; try experimenting with Greek, Korean, or the like.)

Good luck!

Paul

Replies are listed 'Best First'.
Re^2: Can't write cyrillic to DBD::mysql
by Wolfgang (Novice) on Jun 29, 2010 at 10:48 UTC
    Hi Paul,

    Value of $sql seems fine (Below outputted by Devel::Peek).

    Test with Greek shows the same problem. String for Adresse2 is 'дц alpha beta'

    SV = PV(0xa494174) at 0x4df06fc REFCNT = 2 FLAGS = (PADMY,POK,pPOK,UTF8) PV = 0x9ea2894 "UPDATE users SET Adresse2='\303\244\303\266 \316\261 +\316\262' WHERE CONVERT( `users`.`Username` USING utf8 ) ='t est' LIMIT 1;"\0 [UTF8 "UPDATE users SET Adresse2='\x{e4}\x{f6} \x{3b1 +}\x{3b2}' WHERE CONVERT( `users`.`Username` USING utf8 ) ='t est' LIMIT 1;"] CUR = 101 LEN = 104

    But what does that tell us?

    Still confused
    Wolfgang