Any solution to the 4-byte utf8 characters problem?
Posted by: Florin H
Date: March 19, 2010 09:50PM

Hello,

I've just stumbled over a "Incorrect string value: ‘\xF0\x90\x80\x80\xF0\x90…’ for column ‘xxx’" error. After reading about it and looking at the data that is being written I found out that I'm trying to insert into the above column a text that contains 4-byte utf-8 characters. And I've also read that MySQL doesn't handle these kind of characters.

This is what I found on the bugs.mysql.com site: "The driver sets the sql_mode
to 'strict_trans_tables', which means you'll get a truncation error when you try and use unicode characters that are represented with more than 3 bytes in utf-8."

My question is: is there a way around this problem? I don't want to search every string for bad characters in my application code, can't I do it at DB level? Isn't there a setting or a parameter in MySQL that can parse/remove the bad characters so that I can add the string to the DB?

Thank you...

Options: ReplyQuote


Subject
Views
Written By
Posted
Any solution to the 4-byte utf8 characters problem?
7216
March 19, 2010 09:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.