Knowledgebase: Programming & Languages
Making different character sets to display correctly
Posted by Staff Team, Last modified by Sabi D. on 04 March 2007 07:43 PM

Many web browsers display Western Character Encoding (ISO-8859-1) by default. This means that pages with text in a non Western alphabet, like Cyrillic or Arabic, will often look garbled. Unicode, on the other hand, is capable of displaying several alphabets; the standard Unicode encoding is UTF-8.

Not all character sets will be correctly rendered with this encoding format, but most will. You can find specific information about which character encoding will display here.

To ensure that your web page displays correctly across different web browsers and platforms (if it's not in English), you should take the following steps:

1. In your HTML document, insert an XML line which specifies your character encoding under your Doc Type Declaration (DTD). If you're using UTF-8, then the line will look like this:

<?xml encoding="UTF-8"?>

2. When coding your HTML, be sure to include a META tag in your header specifying the character set. If you're going to encode your page in Unicode, specify UTF-8 as your character set in the META tag. If you're going to use UTF-8 encoding, your META tag will look like this:

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">

3. When saving your HTML, be sure that the character encoding is set to whatever you've specified it to be. If you choose UTF-8, then you will need to save your page in that type of encoding.

4. In your IndicHosts.net account, add an .htaccess file in the directory where your web pages using non Western encoding will be. If your entire site uses different characters, then you can put your .htaccess file in /public_html. Inside of the .htaccess file, add this line:

AddDefaultCharset Off

(1269 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).