Converting multilingual text from binary to text utf8
Posted by: Michael Goller
Date: July 22, 2010 10:50AM

Hi - I have an odd problem that I am stymied with. My php/mysql system stores multilingual text in a BLOB field. I want to add Full Text search for the system which means I have to get the data out of the blob and into a TEXT field. Problem is, no matter what I do, once the data is in the TEXT, when I retrieve the data and display it in the browser it shows up as question marks instead of characters.

I have tried the following without success:
(1) created a text field in the table and used an update statement to copy the data to it
(2) created a varchar field in the table and used an update statement to copy the data to it
(3) repeated steps (1) and (2) using the CONVERT function in the SQL

A few other notes:
-I output the data from the BLOB to a csv file, then read it and display it from PHP and the characters look fine (chinese, japanese, hebrew etc.)
- I output data to csv, the load it back into the script and update the table with it and still get question marks.
- The header of the php page is set for utf8
- The form through which data is entered in the system is set to accept utf8 charset
-Data saved in the blob comes out without any problem; it's only data that's converted that's a problem

The reason the data is in a BLOB is that there could be a HUGE number of characters stored in that field, and I didn't know about the TEXT data type at the time. Now I need to move the data to TEXT and have 3000 rows of multilingual data already.

Question:

What is the proper way to convert or move my multilingual data from the BLOB to a TEXT field such that the data is preserved properly and accessible as multilingual data in utf8?

-THE BINARY DATA IN BOTH THE BLOB AND TEXT/VARCHAR IS EXACTLY THE SAME AFTER THE UPDATE, so I know the bits are ok. It's got to be some encoding issue that I don't understand.

Any help is appreciated.

Thanks,
Michael

Options: ReplyQuote


Subject
Views
Written By
Posted
Converting multilingual text from binary to text utf8
6587
July 22, 2010 10:50AM


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.