Jump to content

Arabic Charset Encoding Problem?


wadboram

Recommended Posts

I'm having a membership site (PHP script) allowing members to have a conversation in the forms of send/receive forms. These messages are saved inside the database (Inbox)

 

When I translated the language files and ran the script, all the Arabic translated text showed questions marks. so I added AddDefaultCharset WINDOWS-1256 line inside the .htaccess file and everything worked fine. The character encoding in the browser is showing (Arabic Windows 1256)

 

Then when testing to send/receive messages between members, I got strange characters like this ظ…ط­ظ…ط¯ طµظ„ط§ط­ ط§ظ„ط¯ظ?ظ†  in both their mail boxes and also inside the database. But when I change the browser's character encoding to UNICODE (UTF-8), these messages appear right showing Arabic characters but the whole site's Arabic text shows question marks?

 

I think there's a conflict in the encoding for the site... Can anyone help?

 

 

Link to comment
Share on other sites

I'm no expert, but i've generally found that if you use UTF-8 for EVERYTHING, then all is good :) - so make sure any webpage charsets, the database charsets etc are all set to utf-8 - and i have yet to find any language characters (including stuff like russian, arabic etc) that display incorrectly.

 

Also bear in my that if you use any string function like strlen or watever then be careful as the character are stored in more the one byte so you will need to use the multibyte string functions instead.

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.