Welcome to WebmasterWorld Guest from 54.163.25.166

Forum Moderators: open

Message Too Old, No Replies

properly display certain characters in a javascript select menu.

     
1:48 pm on Apr 10, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 8, 2004
posts: 500
votes: 0


Hi,

I don't know how to tackle this, I need to display the and ū characters like I write them here in a dynamically created javascript select box. Is there a certain function I can call on this to display these characters properly?

Seems javascript doesn't play nice with Unicode characters...

I simply write strings like obj.options[obj.options.length] = new Option('ū'),'133'); to a container, but they are encoded in the DB like &#363, so I use PHP's html_entity_decode() on the database result first, next I need to prepare for javascript, but this fails....

edit: seems WebmasterWorld doesn't like the Unicode Character 'LATIN SMALL LETTER U WITH MACRON' (U+016B) either....

6:18 pm on Apr 10, 2008 (gmt 0)

Moderator from CA 

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
posts:4059
votes: 0


try:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7:21 am on Apr 11, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 8, 2004
posts: 500
votes: 0


thanks, doesnt work though

I really think it is going wrong on the javascript side though, I dont have any problems displaying those characters with just PHP :)

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members