I am new in html programming . I want to add the arabic text in the my html file . I added the following line with arabic text:
<h1 dir="rtl">نص تجريبي لاختبار</h1>
But in output i am getting some unexpected output like :
عظ� ظ�ظ،ظ�عظ�ع عظ�ظ�ظ�ظ�ظ�ظ�
I dont understand why this is happening . Or do need to add some extra code for arabic ?
I am new in html programming . I want to add the arabic text in the my html file . I added the following line with arabic text:
<h1 dir="rtl">نص تجريبي لاختبار</h1>
But in output i am getting some unexpected output like :
عظ� ظ�ظ،ظ�عظ�ع عظ�ظ�ظ�ظ�ظ�ظ�
I dont understand why this is happening . Or do need to add some extra code for arabic ?
Share Improve this question edited Jan 28, 2013 at 8:47 ıllıllı lק ıllıllı 8082 gold badges19 silver badges40 bronze badges asked Jan 28, 2013 at 6:27 xtremextreme 1,9012 gold badges11 silver badges8 bronze badges 2- 1 It is a charset problem. You need to define a charset wich can contains arabic characters like UTF-8. Add this meta at the beginning of your html page : <meta charset="utf-8"> – sdespont Commented Jan 28, 2013 at 6:32
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> add this code in your html – ıllıllı lק ıllıllı Commented Jan 28, 2013 at 8:43
2 Answers
Reset to default 6I think is caused by the character set you used in you HTML file. Check out the wiki page about charset
http://en.wikipedia/wiki/Character_encodings_in_HTML
And, this problem can also be caused by using a different charset in your text editor from your HTML charset.
For non-ascii chars, I remend to use UTF-8 as the charset. So you can add this line into your HTML file. in the <head> tag.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
This is a character encoding issue. From the symptoms, it seems that the HTML document is in fact UTF-8 encoded, which is fine, but it is being treated as being in another encoding, probably ISO-8859-6. You can check this out by selecting UTF-8 in the character encoding menu in “View” mand (or equivalent) in your browser when viewing your page.
To fix this, make sure that the HTTP headers sent by server declare the encoding as UTF-8, or at least leave it unspecified. You can e.g. Rex Swain’s HTTP header viewer to check this out. In addition, add the tag <meta charset=utf-8>
as the first subelement of the head
element; this alone would suffice if the server does not declare character encoding at all (i.e., it says Content-Type: text/html
without charset
parameter).
If more information is needed, check out the W3C page on character encodings.