In JavaScript I can do this:
foo = \"\\u2669\" // 1/4 note
But I can\'t do this
foo = \"\\u1D15D\" // full note -five hex digi
You can use this:
function fromOutsideBMP(cp) {
// 0x01D120
var x=cp-0x10000;
var top10=parseInt("11111111110000000000",2);
var end10=parseInt("1111111111",2);
var part1=(x&top10)/1024+0xD800;
var part2=(x&end10)+0xDC00;
var s=String.fromCharCode(part1)+String.fromCharCode(part2);
return s;
}
Example:
> fromOutsideBMP(0x01d122)
"