Jump to content

mysql and arabic encoding ( collation )


maverick5x

Recommended Posts

Hello all,

I am trying to add arabic content inside some insert statements into mysql through phpMyAdmin

When i import this file that includes the sql statements the data are imported but with problems

The default server collation is UTF8
The tables' collation is cp1256(arabic(windows))
The fields that contain text such as Text,varchar are cp1256_general_ci

but when i select from the tables the data retrieved appear as question marks instead of original letters although the application sets the page encoding to arabic windows.

I have tried several things which did not work and wondering where the problem can be.

I am requesting your help here

Thanks in advance.
Link to comment
Share on other sites

Collation order defines the order in which data is sorted, but not the format in which it's stored.  That's a question of "character set" and "character encoding", not "collation order".  I can't help you with that in mysql, but that should point you in the right direction.

One safe but inefficient option is to encode your data, for example with urlencode.  That will armor it so it can be stored in virtually any character set.  But you will have to urldecode it every time you fetch it.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.