Domanda

I have made a sample webpage in hindi. The code is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>  

<body>
&#2361;&#2367;&#2344;&#2381;&#2342;&#2367;&#2350;&#2375;&#2348;&#2342;&#2354;&#2344;&#2366;
</body>
</html>

But I want the source code to appear in hindi as well (just like the BBC hindi website) and not in unicode. I mean ह instead of &#2361; How can I do this?

È stato utile?

Soluzione

You can get Devanagari characters in your HTML source by not using HTML entities when creating the file. The following lines are equivalent.

<p>अ आ इ ई</p>
<p>&#2309; &#2310; &#2311; &#2312;</p>

If you are generating your HTML from a database, you might be applying an HTML entity conversion function at the time of generating the markup (such as htmlentities() in PHP). You'll have to remove that function call or apply it selectively.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top