How do I get different character sets to display in HTML?

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 www.w3.org/International/O-charset.en.php.

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: 

- 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: 



- 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: 



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

- In your Modwest 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 /htdocs. Inside of the .htaccess file, add this line: AddDefaultCharset Off

Was this answer helpful?

 Print this Article

Also Read

Fix for Filezilla Failing to Retrieve Directory Listing

Windows Server FTP issue Filezilla uses Passive Mode by default. It seems you are having...

How do I perform a trace route?

Traceroute (tracert) works by sending a packet to an open UDP port on a destination machine. For...

How do I setup custom php.ini settings?

We have recently updated many of our shared hosting servers to php 5 with phpSuExec enabled. This...

Error: register_globals is disabled in your PHP

If you installed a new script and are getting the 500 error trying to load the page please see...

How to flush DNS cache in my PC?

How to flush DNS cache in Linux / Windows / Mac Flush dns to get a new name resolution. Also...