Jump to content

Storing foreign characters


johnrb87

Recommended Posts

Hi all

 

I have a database table with a whole load of foreign words in it, they are basically company names and location names, but they are stored in different languages such as Indian, French, Arabic, Chinese and so on.

 

So for example, I have data such as

 

الفجيرة
Ra's al Khaymah

 

But in the database this data is stored as

 

"VARCHAR" with "utf8_bin"

 

and the data is stored like

 

Ø§Ù„ÙØ¬ÙŠØ±Ø©

 

 

This is fine, because it correctly decodes on the front end and the correct symbols etc.

 

My problem is that I want to have another column in the same database which shows the correct converted value, so in the database, it would look something like

 

Ø§Ù„ÙØ¬ÙŠØ±Ø©        الفجيرة

 

 

so on the left side, it would show the encoded value, and on the right side, it would have the true value.

 

I tried writing a script to grab the value from the table and then insert it into the same row, but whenever I try and pass

 

الفجيرة

 

though an "UPDATE" script, it keeps converting that value to

 

Ø§Ù„ÙØ¬ÙŠØ±Ø©

 

So my question is, is there anyway to tell PHP to insert

 

الفجيرة

 

into the database, rather than it inserting

 

Ø§Ù„ÙØ¬ÙŠØ±Ø©

 

instead???

 

Any help would be great.

 

Thanks

 

JohN

Link to comment
https://forums.phpfreaks.com/topic/207139-storing-foreign-characters/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.