IE 8 or older cannot render khmer text

467 views Asked by At

Just like all developers(even non-web ones), I have problems with IE too, beside the layout, css and html problems, recetly I just got a new issue about rendering khmer text content.
I have following text data
កម្ពុជា | Khmer
IE 8 or older cannot render the above, I also escape the text data from utf-8 to ascii like following, same result.
ខ្មែរ | Khmer
I set the utf-8 contect type with both http response header and meta data, no success.
I also tested with html 5, html 4.01 and xhtml 1.1, same result.
What am I supposed to do now?


EDIT:
an example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/></head>
<body>
 <div>
  <span>កម្ពុជា | Khmer</span><br/>
  <span>&#6017;&#6098;&#6040;&#6082;&#6042; | Khmer</span>
 </div>
</body>
</html>
1

There are 1 answers

1
Benjamin BALET On

You must meet these conditions :

  • The source file must be encoded with UTF-8 (no BOM) : you can check it with Notepad++ in Encoding menu. If the encoding is set to something else, select convert to UTF-8 (no BOM).
  • The second thing to keep in mind is that few fonts contain Khmer characters. So you have to choose a font that support Khmer script and include the link where to download it into your HTML code. Go to the Google fonts website. In the left sidebar, select Khmer into Script field. The Google fonts displaying Khmer characters will be listed.

Add this kind of link to your page (adapt this example to the font you chose, everything is well explained on the Google font web page):

<link href='http://fonts.googleapis.com/css?family=Khmer' rel='stylesheet' type='text/css'>

Then apply the style for any element you want (or the whole body):

font-family: 'Khmer', cursive;

Another great Google project is the noto font : a font that will contains all known Unicode characters. You can google for KhmerOS project too.