To express, for example, the character U+10400 in JavaScript, I use "\uD801\uDC00" or String.fromCharCode(0xD801) + String.fromCharCode(0xDC00). How do I figure that out for a given unicode character? I want the following:
var char = getUnicodeCharacter(0x10400);
How do I find 0xD801 and 0xDC00 from 0x10400?
Based on the wikipedia article given by Henning Makholm, the following function will return the correct character for a code point: