T
Thomas Kraft
Hi List,
i have a problem displaying asian characters (japanese or chinese) in an
javascript alert box.
I have: A Excel File from my customer with japanese and chinese strings.
I need: A javascript alert box which shows exactly the same strings.
What i tried:
- I tried to put this strings directly as a string into the alert box.
This is showing strange characters. For example:
alert('ブ'); shows three characters, and 'ブ'.length is also 3.
- i tried some encodings i found in the history of this group like
alert('\u23455'); or alert('実'); without any success. The \u
variant showed two characters (empty box and a 5) and the & variant
showed exactly 実 so the escaping did not work with both variants.
What i found:
Something like alert(String.fromCharCode(55038)); shows me some
(chinese?) character in the alert box.
What i try to reach now:
I need to know how i will be able to convert this strings from excel to
values i can use in this fromCharCode() function. (If this is somehow
possible)
When i save this single japanese character from above in a textfile and
save this to harddisk and look at this file with hex editor it shows
like this:
E3 A3 96
I tried hours of converting this 3 Byte hex String to decimal numbers
and put into alert box to look if this japanese character will appear,
but without success. I saw a lot of funny asian symbols as well as some
arabic symbols but was not successful to see this specific char.
Anyone has any Idea how to find out which code i need to see my japanese
and chinese characters? Any help will be highly appreciated.
Thanks in advance,
Thomas Kraft
i have a problem displaying asian characters (japanese or chinese) in an
javascript alert box.
I have: A Excel File from my customer with japanese and chinese strings.
I need: A javascript alert box which shows exactly the same strings.
What i tried:
- I tried to put this strings directly as a string into the alert box.
This is showing strange characters. For example:
alert('ブ'); shows three characters, and 'ブ'.length is also 3.
- i tried some encodings i found in the history of this group like
alert('\u23455'); or alert('実'); without any success. The \u
variant showed two characters (empty box and a 5) and the & variant
showed exactly 実 so the escaping did not work with both variants.
What i found:
Something like alert(String.fromCharCode(55038)); shows me some
(chinese?) character in the alert box.
What i try to reach now:
I need to know how i will be able to convert this strings from excel to
values i can use in this fromCharCode() function. (If this is somehow
possible)
When i save this single japanese character from above in a textfile and
save this to harddisk and look at this file with hex editor it shows
like this:
E3 A3 96
I tried hours of converting this 3 Byte hex String to decimal numbers
and put into alert box to look if this japanese character will appear,
but without success. I saw a lot of funny asian symbols as well as some
arabic symbols but was not successful to see this specific char.
Anyone has any Idea how to find out which code i need to see my japanese
and chinese characters? Any help will be highly appreciated.
Thanks in advance,
Thomas Kraft