View Full Version : Special characters in a list

02-14-2007, 06:38 PM
Hi all,

My website deals with Chinese characters (http://caractereschinois.free.fr) and I have trouble displaying them in a list.

I used to be able to do it by using innerHTML like for example:

list.innerHTML = '<option>&#25248 ;</option>';
but it turned out that IE did not like it. However this way of dealing with a special character was correctly displayed with Firefox, Safari and Konqueror.

So I switch to a nicer way of creating options in a list:

var newOption = new Option('&#25248 ;', 0);
list.options[0] = newOption;

This works with Firefox and IE but it displays &#25248 ; and not the character ( 抠 ).

How would you do?



PS: The text in the option is actually a long string with special characters in formatted with &#/;. I do not really want to have to interfere with the string itself.

PPS: it was really tricky to get this post to be displayed correctly since every html code is interpreted but &amp; ;-). I could have a correct preview by using &# 38 ; instead of &amp; but I could not get it correct after submitting (a first processing turned it into something that was interpreted as the character itself). I have the opposite problem if I write &#25248 ; ) without a whitespace, the smiley is interpreted before the character itself... this all looks like a lot of fun to come...

02-15-2007, 08:34 AM
Hi, i'll put special characters in a xml file(utf-8 encoded) after that i'll read them with javascript or php and show them.