function toUTF16(unicode) {
  if (unicode >= 0x000000 && unicode <= 0x00ffff) return [ unicode ];
  if (unicode <= 0x10ffff) {
    const c = unicode - 0x10000;
    const high = Math.floor(c/0x400) + 0xD800;
    const low = c%0x400 + 0xDC00;
    return [ high, low ];
  }
  throw Error(`Cannot convert ${unicode} to UTF-16`);
}
Convert Unicode to UTF-16 encoding that JavaScript use for charcodes
@param { number } unicode 
@return { number[] }