Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML web page doctype declaration issue

Tags:

html

utf-8

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.

like image 512
user1010399 Avatar asked Dec 17 '22 05:12

user1010399


1 Answers

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">
like image 59
Purag Avatar answered Jan 14 '23 15:01

Purag