Click here to Skip to main content
15,911,327 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai...
I am using IE7 browser.In that i am using Hindi text in <title></title> and in alert method..but when i run the application the Hindi text doesn't appear it appears like small boxes..

Sample code of me:
ASP.NET
 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="hi" />
    <title>कैसे हो? </title>
</head>
<body>
    <form id="form1"  runat="server">
    <div>
        alert("this is to test hindi title कैसे हो?");s
    </div>
    </form>
</body>
</html>

Please Give me solution for my problem
Posted
Updated 2-Jul-12 2:31am
v2
Comments
ZurdoDev 2-Jul-12 8:27am    
Maybe your system doesn't support that font? Have you tried other systems? Maybe post this on jsfiddle and see what happens for different people.
Rajini.Y 2-Jul-12 8:32am    
Thank you for your quick response....I Tried it in 4 systems but it didn't work..

1 solution

I was only just reading something the other day that said javascript handles Unicode in a funny way. After reading your question, it seems that it's likely that your system is set to English locale. When you then try to show javascript alert messages, you just get boxes. This is the same behaviour reported by readers of Japanese when attempted on a system set to English locale.

From a couple of forum messages I've read, this behaviour is a common flaw.
One poster suggested[^] that the way around it was to use pop-up html dialogs that emulate the look and feel of an alert box. This will allow you to show a message in any language on a system that's set to any locale.

EDIT: (using chrome) Just tried to run the javascript on a Win7 pc - the alert message is the same as the text shown on this page. I saved the file using Notepad, using "Unicode" as the Encoding type. - same result when saving it as UTF-8 too.. :Hmmmmm:

EDIT #2: Using IE8 - worked fine too.


Now, when I try it in a virtual machine loaded with XP, I note something interesting happens - the code (and page title) display as boxes in both IE6 & Chrome 19.
But, it gets better - if I view the source in both IE6 & Chrome, then I DO see the text as displayed on this page. in Chrome, but still see boxes when viewed in IE6. :wtf:

Fun times!

See here[^] for an example.
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900