# Unicode

1 min read, 65 words unicodecodepoint

# codepoint

String.fromCharCode(55356, 57091);
String.fromCodePoint(parseInt("1f61b", 16));
String.fromCodePoint(0x1f1f3);
String.fromCodePoint(0x03c9); // in hexa-decimal
String.fromCodePoint(129321); // in decimal
function countryToFlag(isoCode: string) {
  return typeof String.fromCodePoint !== "undefined"
    ? isoCode.toUpperCase().replace(
        /./g,
        (char) => String.fromCodePoint(char.charCodeAt(0) + 127397) // magic number
      )
    : isoCode;
}

countryToFlag("IN");
countryToFlag("de");
countryToFlag("usa");

Subscribe to our Newsletter

If you like my work and think it was helpful kindly support my work


Buy Me A Coffee