简体   繁体   中英

HTML web page doctype declaration issue

i am designing a webpage which should support the all languages utf-8 . unfortunately some language characters are not recognising on IE but it loks fine on mozilla & chrome, why ?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head> <body>
  <p>Chinese Text : &#24744;&#22909;&#19990;&#30028; </p>
  <p> Indian text : &#2361;&#2375;&#2354;&#2379; &#2357;&#2367;&#2358;&#2381;&#2357; </p>
</body>
</html>

but when i remove the very first line, characters shows on internet explorer (IE) too.

Removed : <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Can someone explain please, what should be correct doctype declaration for multilingual support.

Your charset is currently set to ISO-8859-1 , which is the character set for Western European characters. Change it to UTF-8 to have support for all the Unicode characters:

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

Check out answers to question 3867678 . They seem to say that IE 8 has by default no font set for Chinese characters (though I suppose this applies to some installations only). Setting the font in CSS should help, though I'm not sure what might be an optimal font family list; maybe something like

font-family: Arial Unicode MS, PMingLiU, MingLiU, SimSun

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM