IE7 Does Not Support Some Unicode?

Discussion in 'Javascript' started by vunet.us@gmail.com, Jul 26, 2007.

  1. Guest

    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(select);
    }
    function getPrefSelectObj(arr){
    var s = document.createElement("select");
    try{
    for(var i=0; i<arr.length; i++){
    var vals = arr;
    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);}
    }
    }catch(e){}
    return s;
    }
    </script>
    </head>
    <body onload="f();">
    <div id="myDiv"></div>
    </body>
    </html>
     
    , Jul 26, 2007
    #1
    1. Advertising

  2. David Mark Guest

    On Jul 26, 12:41 pm, 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.
     
    David Mark, Jul 26, 2007
    #2
    1. Advertising

  3. dave Guest

    On Jul 26, 8:41 am, 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(select);}
    >
    > function getPrefSelectObj(arr){
    > var s = document.createElement("select");
    > try{
    > for(var i=0; i<arr.length; i++){
    > var vals = arr;
    > 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);}
    > }
    > }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
     
    dave, Jul 26, 2007
    #3
  4. Guest

    On Jul 26, 3:43 pm, dave <> wrote:
    > On Jul 26, 8:41 am, 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(select);}

    >
    > > function getPrefSelectObj(arr){
    > > var s = document.createElement("select");
    > > try{
    > > for(var i=0; i<arr.length; i++){
    > > var vals = arr;
    > > 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);}
    > > }
    > > }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.
     
    , Jul 26, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. could ildg
    Replies:
    0
    Views:
    346
    could ildg
    Aug 4, 2005
  2. Robert Kern
    Replies:
    0
    Views:
    480
    Robert Kern
    Aug 4, 2005
  3. Jeff Louella

    IE7 on XP vs IE7 on Vista

    Jeff Louella, Mar 1, 2007, in forum: HTML
    Replies:
    9
    Views:
    525
    Adrienne Boswell
    Mar 2, 2007
  4. John Nagle
    Replies:
    1
    Views:
    556
    Martin v. Löwis
    Nov 19, 2009
  5. Ntys Dd
    Replies:
    2
    Views:
    117
    Run Paint Run Run
    Jun 12, 2010
Loading...

Share This Page