It looks like you have to decode surrogate pairs manually. For example:
function decodeUnicode(str) {
var r = [], i = 0;
while(i < str.length) {
var chr = str.charCodeAt(i++);
if(chr >= 0xD800 && chr <= 0xDBFF) {
// surrogate pair
var low = str.charCodeAt(i++);
r.push(0x10000 + ((chr - 0xD800) << 10) | (low - 0xDC00));
} else {
// ordinary character
r.push(chr);
}
}
return r;
}
Complete code: http://jsfiddle.net/twQWU/