Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: DOM CreateTextNode with Unicode

Thread Tools

Re: DOM CreateTextNode with Unicode

Martin Honnen
Posts: n/a
RC wrote:

> var chineseChar = "鼠";

Use JavaScript escape mechanism \uHHHH
var chineseChar = "\u9f20";

Or simply write your JavaScript files in an editor that supports Unicode
and encode the files as UTF-8, that way you can use the character
literally. You only need to make sure the SVG user agent knows the
encoding, either by making sure the server indicates it in a HTTP header
or by giving the encoding in an attribute of the script element
<script xlink:href="script.js"
type="text/javascript; charset=UTF-8"></script>


Martin Honnen
Reply With Quote

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
Re: DOM CreateTextNode with Unicode Thomas 'PointedEars' Lahn XML 0 03-01-2008 12:27 PM
newbie: createTextNode & Div Jeff Javascript 2 11-15-2005 09:13 PM
Question about createTextNode in xml files Danny XML 11 06-23-2005 10:15 PM
Question about createTextNode in xml files DKM Javascript 10 06-23-2005 10:15 PM
When using Xerces, how can I validate the text in createTextNode() Avi U XML 2 01-13-2004 06:16 PM