Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > IE7 Does Not Support Some Unicode?

Reply
Thread Tools

IE7 Does Not Support Some Unicode?

 
 
vunet.us@gmail.com
Guest
Posts: n/a
 
      07-26-2007
Hello,

I translate a website into multiple languages. My AJAX app displays
Unicode characters successfully. One problem, however, is that Chinese
Unicode characters are shown as boxes in HTML select fields in IE7
(not IE6, FF, etc.).
I used UTF-8 encoding set both on the server and in meta tags: it
still does not work.

Since I have no external server, please refer to this copy/paste code
below to clearly see the problem. Please, open in IE7 for problem
demonstration.
Thank you.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function f()
{
var selObjArray = new Array();
selObjArray.push(new Array( "\u67E5\u627E\uFF01", "Look Up"));
selObjArray.push(new Array( "\u9875\u9762\u6D4F\u89C8", "Page
View"));
var select = getPrefSelectObj(selObjArray);
document.getElementById("myDiv").appendChild(selec t);
}
function getPrefSelectObj(arr){
var s = document.createElement("select");
try{
for(var i=0; i<arr.length; i++){
var vals = arr[i];
var option = document.createElement("option");
option.text = vals[0];
option.value = vals[1];
if (document.all){s.add(option);
}else{
s.add(option, s.options[i]);}
}
}catch(e){}
return s;
}
</script>
</head>
<body onload="f();">
<div id="myDiv"></div>
</body>
</html>

 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      07-26-2007
On Jul 26, 12:41 pm, (E-Mail Removed) wrote:
> Hello,
>
> I translate a website into multiple languages. My AJAX app displays
> Unicode characters successfully. One problem, however, is that Chinese
> Unicode characters are shown as boxes in HTML select fields in IE7


That indicates the required fonts aren't installed or your system is
not configured to display them.

> (not IE6, FF, etc.).
> I used UTF-8 encoding set both on the server and in meta tags: it
> still does not work.


Because that isn't the problem.

>
> Since I have no external server, please refer to this copy/paste code
> below to clearly see the problem. Please, open in IE7 for problem
> demonstration.


That won't do any good. I probably don't have the fonts either.
Which raises the question of which font(s) are required to display
these characters. Why is there no style sheet?

Anyway, this is certainly not a JS problem.

 
Reply With Quote
 
 
 
 
dave
Guest
Posts: n/a
 
      07-26-2007
On Jul 26, 8:41 am, (E-Mail Removed) wrote:
> Hello,
>
> I translate a website into multiple languages. My AJAX app displays
> Unicode characters successfully. One problem, however, is that Chinese
> Unicode characters are shown as boxes in HTML select fields in IE7
> (not IE6, FF, etc.).
> I used UTF-8 encoding set both on the server and in meta tags: it
> still does not work.
>
> Since I have no external server, please refer to this copy/paste code
> below to clearly see the problem. Please, open in IE7 for problem
> demonstration.
> Thank you.
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> <script type="text/javascript">
> function f()
> {
> var selObjArray = new Array();
> selObjArray.push(new Array( "\u67E5\u627E\uFF01", "Look Up"));
> selObjArray.push(new Array( "\u9875\u9762\u6D4F\u89C8", "Page
> View"));
> var select = getPrefSelectObj(selObjArray);
> document.getElementById("myDiv").appendChild(selec t);}
>
> function getPrefSelectObj(arr){
> var s = document.createElement("select");
> try{
> for(var i=0; i<arr.length; i++){
> var vals = arr[i];
> var option = document.createElement("option");
> option.text = vals[0];
> option.value = vals[1];
> if (document.all){s.add(option);
> }else{
> s.add(option, s.options[i]);}
> }
> }catch(e){}
> return s;}
>
> </script>
> </head>
> <body onload="f();">
> <div id="myDiv"></div>
> </body>
> </html>


I do have the Asian fonts installed and it works just fine for me.

This is not a JS issue though, rather its an issue with your
computer's set up and the fonts that are installed

 
Reply With Quote
 
vunet.us@gmail.com
Guest
Posts: n/a
 
      07-26-2007
On Jul 26, 3:43 pm, dave <(E-Mail Removed)> wrote:
> On Jul 26, 8:41 am, (E-Mail Removed) wrote:
>
>
>
> > Hello,

>
> > I translate a website into multiple languages. My AJAX app displays
> > Unicode characters successfully. One problem, however, is that Chinese
> > Unicode characters are shown as boxes in HTML select fields in IE7
> > (not IE6, FF, etc.).
> > I used UTF-8 encoding set both on the server and in meta tags: it
> > still does not work.

>
> > Since I have no external server, please refer to this copy/paste code
> > below to clearly see the problem. Please, open in IE7 for problem
> > demonstration.
> > Thank you.

>
> > <html>
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> > <script type="text/javascript">
> > function f()
> > {
> > var selObjArray = new Array();
> > selObjArray.push(new Array( "\u67E5\u627E\uFF01", "Look Up"));
> > selObjArray.push(new Array( "\u9875\u9762\u6D4F\u89C8", "Page
> > View"));
> > var select = getPrefSelectObj(selObjArray);
> > document.getElementById("myDiv").appendChild(selec t);}

>
> > function getPrefSelectObj(arr){
> > var s = document.createElement("select");
> > try{
> > for(var i=0; i<arr.length; i++){
> > var vals = arr[i];
> > var option = document.createElement("option");
> > option.text = vals[0];
> > option.value = vals[1];
> > if (document.all){s.add(option);
> > }else{
> > s.add(option, s.options[i]);}
> > }
> > }catch(e){}
> > return s;}

>
> > </script>
> > </head>
> > <body onload="f();">
> > <div id="myDiv"></div>
> > </body>
> > </html>

>
> I do have the Asian fonts installed and it works just fine for me.
>
> This is not a JS issue though, rather its an issue with your
> computer's set up and the fonts that are installed


I mentioned the problem was in select boxes. If I added those unicode
characters to the page, it worked fine. That's why I thought this
could be JS problem, since my JS puts them as text value into select
options (see function getPrefSelectObj).

Anyway I spent some time working on it too and found out that charset
had to be changed to gb2312 from utf-8. That was the solution.

Thanks everyone trying to help.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 and IE7 64-bit in Vista 64-bit 007 Windows 64bit 1 10-28-2008 08:46 PM
Some people tell that at present, most web hosting servers supportall kinds of programming language, some people tell me that many web hostingserver don't support Java, What is the truth? Erwin Moller Java 3 05-07-2008 05:09 PM
What does "driver does not support your hardware" mean? John Ritchie Computer Information 2 08-04-2007 04:59 AM
How do I setup a 32 bit IE7 since I'm using a 64 Bit IE7 =?Utf-8?B?RXVnZW5l?= Windows 64bit 3 05-06-2007 01:18 PM
IE7 on XP vs IE7 on Vista Jeff Louella HTML 9 03-02-2007 02:25 AM



Advertisments