Reputation: 1333
I'm trying to convert Chinese characters in a XML file to readable Chinese string using javascript, but I'm not sure how to. I have checked other SO posts, and tried the following
unescape(encodeURIComponent('丘'))
but still can't get it to work, and wondering if someone could help?
<utf8>丘</utf8>
Upvotes: 0
Views: 359
Reputation: 664425
Neither unescape
nor encodeURIComponent
(which deal with percent-encoding) will help you with a XML character entity. You just want to parse the XML file! Accessing the DOM then will yield the expected string.
Upvotes: 1