niedziela, 18 kwietnia 2010

WebOrb Flex and unicode encoding

During work on my WebOrb - Flex project I run into problem with character encoding. I had MySQL database configured with unicode, properly configured connection

mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES utf8");

My data from flex was correctly stored in database, but when I was trying to read it back i was receiving malformed unicode string with all unicode characters presented as two ASCII chars.

The solution of this problem is removing utf8_encode function from begining of FlashBinaryWriter.php in weborb directory OR inserting application in all places where there is a possibility to receive unicode data (ie. database queries) utf8_decode