Reputation: 31
I am designing a web page this web page should support
English and Arabic languages
my problem is : Arabic characters doesn't appear in its way
it appears some thing like that "أهلاً يا معلم "
I have tried to change the encoding of this page with the following tag
<META CONTENT="text/html; charset=windows-1256" HTTP-EQUIV="Content-Type">
but it didn't work and I tried the "utf-8" but it doesn't work either?
thanks for reading my question
Upvotes: 1
Views: 6531
Reputation: 11546
Here's the bulletproof way I use. First instruct PHP to deal with UTF8 all the way:
mb_internal_encoding('UTF-8');
iconv_set_encoding('internal_encoding', 'UTF-8');
iconv_set_encoding('output_encoding', 'UTF-8');
header('Content-type: text/html; charset=UTF-8');
Then double-check that the browser knows that we're using the UTF scheme:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Upvotes: 1
Reputation: 449435
The answer to your question is most certainly UTF-8.
As good basic reading, I recommend The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
If you want more detailed help here, you will have to describe what exactly you do: Where your data comes from, whether you use a CMS and so on. (Update: @Pascal Martin already mentioned all the important points).
Upvotes: 1
Reputation: 124768
Set your page's encoding to UTF-8 using the meta
method and make sure your files are saved in UTF-8 (in your editor, check that the encoding used is UTF-8).
Upvotes: 0
Reputation: 401002
You need to change more than that : ideally, everything should be set to, or encoded in, UTF-8 :
For the last part, this should do the trick, in PHP :
header('Content-type: text/html; charset=UTF-8');
(You might need to adjust it, depending on your... content-type ^^ )
Upvotes: 2