Skip to content

HTML Entity Encoder/Decoder — C++ source

Encode text to HTML entities and decode entities back to text (named + numeric). UTF-8 safe, runs entirely in your browser, with a shareable link to your exact input.

This is the C++ implementation — the same logic the interactive tool runs, in a shareable, citable form.

// =============================================================================
//  html-entity-encoder.cpp — CosmoDev polyglot showcase port of the
//  `html-entity-encoder` tool
//  -----------------------------------------------------------------------------
//  Language : C++ (C++17, standard library only)
//  Source:   ported from src/lib/htmlEntities.ts (the canonical, live
//             TypeScript lib); mirrors
//             src/tool-sources/html-entity-encoder/{python.py,rust.rs}
//  License  : display source — part of CosmoDev's polyglot tool pages
//             (dev.cosmolabs.org). Shown verbatim alongside the JS/TS/Go/Rust/
//             Python ports and the other language ports.
//  -----------------------------------------------------------------------------
//  HTML entity encode / decode — pure string transforms that never throw.
//  Encode escapes the five HTML-significant characters (& < > ' ") and can
//  optionally flatten every non-ASCII code point to a decimal numeric
//  reference. Decode resolves named (&amp;, &copy;, …), decimal (&#169;), and
//  hex (&#xA9;) references; unknown or malformed references pass through
//  whole.
//
//  Behavior matches the TypeScript lib exactly: same inputs yield identical
//  outputs, including the lone-surrogate and out-of-range guards (decode
//  never throws on bad input — unresolvable references are returned verbatim).
//
//  The reference scanner is hand-rolled (std::regex is standard but famously
//  heavy for one pattern; a byte scanner mirrors the Rust port) and walks the
//  input by UTF-8 code point, so an astral character such as an emoji encodes
//  as a single &#N; reference rather than two surrogate halves.
//
//  The named-entity table is the full WHATWG HTML named-character-reference
//  set (2125 entries), generated from src/lib/htmlEntityTable.ts so the data
//  stays byte-identical to the canonical TypeScript lib.
// =============================================================================

#include <cstddef>
#include <cstdint>
#include <string>
#include <string_view>
#include <unordered_map>

namespace cosmodev {

/// Encode options.
struct encode_options {
    /// When true, every non-ASCII code point is also emitted as a decimal
    /// numeric reference (e.g. © → &#169;), producing ASCII-safe output.
    /// When false (the default), only the five HTML-significant characters
    /// are escaped.
    bool ascii = false;
};

namespace detail {

/// A parsed reference. `end` is the index just past the closing ';'. When
/// `resolved` is true the decoded bytes live in `value`; otherwise the caller
/// must emit the original text[start..end) verbatim.
struct reference {
    std::size_t end = 0;
    std::string value;
    bool resolved = false;
};

/// true when c is a valid digit for the radix (10 or 16).
inline bool entity_digit(char c, bool hex) {
    if (c >= '0' && c <= '9') {
        return true;
    }
    return hex && ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
}

/// Numeric value of one hex/decimal digit (caller guarantees entity_digit).
inline unsigned digit_value(char c) {
    if (c <= '9') {
        return static_cast<unsigned>(c - '0');
    }
    return static_cast<unsigned>(c <= 'F' ? c - 'A' + 10 : c - 'a' + 10);
}

/// ASCII [A-Za-z]. Locale-free range checks — std::isalpha would be at the
/// mercy of the C locale.
inline bool ascii_letter(char c) {
    return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}

/// ASCII [A-Za-z0-9].
inline bool ascii_alnum(char c) {
    return ascii_letter(c) || (c >= '0' && c <= '9');
}

/// Decode one UTF-8 code point at s[0..len). Stores its scalar value in *cp
/// and returns the byte length consumed (1–4). Returns 0 when the bytes are
/// not a valid UTF-8 sequence; callers then treat the lead byte as a single
/// unit and copy it through, keeping decode total on hostile input.
inline std::size_t utf8_next(const unsigned char* s, std::size_t len,
                             std::uint32_t* cp) {
    unsigned char b = s[0];
    if (b < 0x80) {
        *cp = b;
        return 1;
    }
    if ((b & 0xE0) == 0xC0 && len >= 2 && (s[1] & 0xC0) == 0x80) {
        *cp = (static_cast<std::uint32_t>(b & 0x1F) << 6) |
              static_cast<std::uint32_t>(s[1] & 0x3F);
        return 2;
    }
    if ((b & 0xF0) == 0xE0 && len >= 3 && (s[1] & 0xC0) == 0x80 &&
        (s[2] & 0xC0) == 0x80) {
        *cp = (static_cast<std::uint32_t>(b & 0x0F) << 12) |
              (static_cast<std::uint32_t>(s[1] & 0x3F) << 6) |
              static_cast<std::uint32_t>(s[2] & 0x3F);
        return 3;
    }
    if ((b & 0xF8) == 0xF0 && len >= 4 && (s[1] & 0xC0) == 0x80 &&
        (s[2] & 0xC0) == 0x80 && (s[3] & 0xC0) == 0x80) {
        *cp = (static_cast<std::uint32_t>(b & 0x07) << 18) |
              (static_cast<std::uint32_t>(s[1] & 0x3F) << 12) |
              (static_cast<std::uint32_t>(s[2] & 0x3F) << 6) |
              static_cast<std::uint32_t>(s[3] & 0x3F);
        return 4;
    }
    return 0;
}

/// Append the UTF-8 encoding of cp to out. cp must be a valid scalar value
/// (callers reject surrogates and values above U+10FFFF before reaching
/// here).
inline void append_utf8(std::string& out, std::uint32_t cp) {
    if (cp < 0x80) {
        out.push_back(static_cast<char>(cp));
    } else if (cp < 0x800) {
        out.push_back(static_cast<char>(0xC0 | (cp >> 6)));
        out.push_back(static_cast<char>(0x80 | (cp & 0x3F)));
    } else if (cp < 0x10000) {
        out.push_back(static_cast<char>(0xE0 | (cp >> 12)));
        out.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3F)));
        out.push_back(static_cast<char>(0x80 | (cp & 0x3F)));
    } else {
        out.push_back(static_cast<char>(0xF0 | (cp >> 18)));
        out.push_back(static_cast<char>(0x80 | ((cp >> 12) & 0x3F)));
        out.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3F)));
        out.push_back(static_cast<char>(0x80 | (cp & 0x3F)));
    }
}

/// The lazily-initialized named-entity lookup table. Built once on first
/// decode and shared thereafter (function-local static — the C++ equivalent
/// of the Rust port's std::sync::OnceLock).
inline const std::unordered_map<std::string, std::string>& entity_table() {
    static const std::unordered_map<std::string, std::string> table = {
        { "AElig", u8"Æ" },
        { "AMP", u8"&" },
        { "Aacute", u8"Á" },
        { "Abreve", u8"Ă" },
        { "Acirc", u8"Â" },
        { "Acy", u8"А" },
        { "Afr", u8"𝔄" },
        { "Agrave", u8"À" },
        { "Alpha", u8"Α" },
        { "Amacr", u8"Ā" },
        { "And", u8"⩓" },
        { "Aogon", u8"Ą" },
        { "Aopf", u8"𝔸" },
        { "ApplyFunction", u8"⁡" },
        { "Aring", u8"Å" },
        { "Ascr", u8"𝒜" },
        { "Assign", u8"≔" },
        { "Atilde", u8"Ã" },
        { "Auml", u8"Ä" },
        { "Backslash", u8"∖" },
        { "Barv", u8"⫧" },
        { "Barwed", u8"⌆" },
        { "Bcy", u8"Б" },
        { "Because", u8"∵" },
        { "Bernoullis", u8"ℬ" },
        { "Beta", u8"Β" },
        { "Bfr", u8"𝔅" },
        { "Bopf", u8"𝔹" },
        { "Breve", u8"˘" },
        { "Bscr", u8"ℬ" },
        { "Bumpeq", u8"≎" },
        { "CHcy", u8"Ч" },
        { "COPY", u8"©" },
        { "Cacute", u8"Ć" },
        { "Cap", u8"⋒" },
        { "CapitalDifferentialD", u8"ⅅ" },
        { "Cayleys", u8"ℭ" },
        { "Ccaron", u8"Č" },
        { "Ccedil", u8"Ç" },
        { "Ccirc", u8"Ĉ" },
        { "Cconint", u8"∰" },
        { "Cdot", u8"Ċ" },
        { "Cedilla", u8"¸" },
        { "CenterDot", u8"·" },
        { "Cfr", u8"ℭ" },
        { "Chi", u8"Χ" },
        { "CircleDot", u8"⊙" },
        { "CircleMinus", u8"⊖" },
        { "CirclePlus", u8"⊕" },
        { "CircleTimes", u8"⊗" },
        { "ClockwiseContourIntegral", u8"∲" },
        { "CloseCurlyDoubleQuote", u8"”" },
        { "CloseCurlyQuote", u8"’" },
        { "Colon", u8"∷" },
        { "Colone", u8"⩴" },
        { "Congruent", u8"≡" },
        { "Conint", u8"∯" },
        { "ContourIntegral", u8"∮" },
        { "Copf", u8"ℂ" },
        { "Coproduct", u8"∐" },
        { "CounterClockwiseContourIntegral", u8"∳" },
        { "Cross", u8"⨯" },
        { "Cscr", u8"𝒞" },
        { "Cup", u8"⋓" },
        { "CupCap", u8"≍" },
        { "DD", u8"ⅅ" },
        { "DDotrahd", u8"⤑" },
        { "DJcy", u8"Ђ" },
        { "DScy", u8"Ѕ" },
        { "DZcy", u8"Џ" },
        { "Dagger", u8"‡" },
        { "Darr", u8"↡" },
        { "Dashv", u8"⫤" },
        { "Dcaron", u8"Ď" },
        { "Dcy", u8"Д" },
        { "Del", u8"∇" },
        { "Delta", u8"Δ" },
        { "Dfr", u8"𝔇" },
        { "DiacriticalAcute", u8"´" },
        { "DiacriticalDot", u8"˙" },
        { "DiacriticalDoubleAcute", u8"˝" },
        { "DiacriticalGrave", u8"`" },
        { "DiacriticalTilde", u8"˜" },
        { "Diamond", u8"⋄" },
        { "DifferentialD", u8"ⅆ" },
        { "Dopf", u8"𝔻" },
        { "Dot", u8"¨" },
        { "DotDot", u8"⃜" },
        { "DotEqual", u8"≐" },
        { "DoubleContourIntegral", u8"∯" },
        { "DoubleDot", u8"¨" },
        { "DoubleDownArrow", u8"⇓" },
        { "DoubleLeftArrow", u8"⇐" },
        { "DoubleLeftRightArrow", u8"⇔" },
        { "DoubleLeftTee", u8"⫤" },
        { "DoubleLongLeftArrow", u8"⟸" },
        { "DoubleLongLeftRightArrow", u8"⟺" },
        { "DoubleLongRightArrow", u8"⟹" },
        { "DoubleRightArrow", u8"⇒" },
        { "DoubleRightTee", u8"⊨" },
        { "DoubleUpArrow", u8"⇑" },
        { "DoubleUpDownArrow", u8"⇕" },
        { "DoubleVerticalBar", u8"∥" },
        { "DownArrow", u8"↓" },
        { "DownArrowBar", u8"⤓" },
        { "DownArrowUpArrow", u8"⇵" },
        { "DownBreve", u8"̑" },
        { "DownLeftRightVector", u8"⥐" },
        { "DownLeftTeeVector", u8"⥞" },
        { "DownLeftVector", u8"↽" },
        { "DownLeftVectorBar", u8"⥖" },
        { "DownRightTeeVector", u8"⥟" },
        { "DownRightVector", u8"⇁" },
        { "DownRightVectorBar", u8"⥗" },
        { "DownTee", u8"⊤" },
        { "DownTeeArrow", u8"↧" },
        { "Downarrow", u8"⇓" },
        { "Dscr", u8"𝒟" },
        { "Dstrok", u8"Đ" },
        { "ENG", u8"Ŋ" },
        { "ETH", u8"Ð" },
        { "Eacute", u8"É" },
        { "Ecaron", u8"Ě" },
        { "Ecirc", u8"Ê" },
        { "Ecy", u8"Э" },
        { "Edot", u8"Ė" },
        { "Efr", u8"𝔈" },
        { "Egrave", u8"È" },
        { "Element", u8"∈" },
        { "Emacr", u8"Ē" },
        { "EmptySmallSquare", u8"◻" },
        { "EmptyVerySmallSquare", u8"▫" },
        { "Eogon", u8"Ę" },
        { "Eopf", u8"𝔼" },
        { "Epsilon", u8"Ε" },
        { "Equal", u8"⩵" },
        { "EqualTilde", u8"≂" },
        { "Equilibrium", u8"⇌" },
        { "Escr", u8"ℰ" },
        { "Esim", u8"⩳" },
        { "Eta", u8"Η" },
        { "Euml", u8"Ë" },
        { "Exists", u8"∃" },
        { "ExponentialE", u8"ⅇ" },
        { "Fcy", u8"Ф" },
        { "Ffr", u8"𝔉" },
        { "FilledSmallSquare", u8"◼" },
        { "FilledVerySmallSquare", u8"▪" },
        { "Fopf", u8"𝔽" },
        { "ForAll", u8"∀" },
        { "Fouriertrf", u8"ℱ" },
        { "Fscr", u8"ℱ" },
        { "GJcy", u8"Ѓ" },
        { "GT", u8">" },
        { "Gamma", u8"Γ" },
        { "Gammad", u8"Ϝ" },
        { "Gbreve", u8"Ğ" },
        { "Gcedil", u8"Ģ" },
        { "Gcirc", u8"Ĝ" },
        { "Gcy", u8"Г" },
        { "Gdot", u8"Ġ" },
        { "Gfr", u8"𝔊" },
        { "Gg", u8"⋙" },
        { "Gopf", u8"𝔾" },
        { "GreaterEqual", u8"≥" },
        { "GreaterEqualLess", u8"⋛" },
        { "GreaterFullEqual", u8"≧" },
        { "GreaterGreater", u8"⪢" },
        { "GreaterLess", u8"≷" },
        { "GreaterSlantEqual", u8"⩾" },
        { "GreaterTilde", u8"≳" },
        { "Gscr", u8"𝒢" },
        { "Gt", u8"≫" },
        { "HARDcy", u8"Ъ" },
        { "Hacek", u8"ˇ" },
        { "Hat", u8"^" },
        { "Hcirc", u8"Ĥ" },
        { "Hfr", u8"ℌ" },
        { "HilbertSpace", u8"ℋ" },
        { "Hopf", u8"ℍ" },
        { "HorizontalLine", u8"─" },
        { "Hscr", u8"ℋ" },
        { "Hstrok", u8"Ħ" },
        { "HumpDownHump", u8"≎" },
        { "HumpEqual", u8"≏" },
        { "IEcy", u8"Е" },
        { "IJlig", u8"IJ" },
        { "IOcy", u8"Ё" },
        { "Iacute", u8"Í" },
        { "Icirc", u8"Î" },
        { "Icy", u8"И" },
        { "Idot", u8"İ" },
        { "Ifr", u8"ℑ" },
        { "Igrave", u8"Ì" },
        { "Im", u8"ℑ" },
        { "Imacr", u8"Ī" },
        { "ImaginaryI", u8"ⅈ" },
        { "Implies", u8"⇒" },
        { "Int", u8"∬" },
        { "Integral", u8"∫" },
        { "Intersection", u8"⋂" },
        { "InvisibleComma", u8"⁣" },
        { "InvisibleTimes", u8"⁢" },
        { "Iogon", u8"Į" },
        { "Iopf", u8"𝕀" },
        { "Iota", u8"Ι" },
        { "Iscr", u8"ℐ" },
        { "Itilde", u8"Ĩ" },
        { "Iukcy", u8"І" },
        { "Iuml", u8"Ï" },
        { "Jcirc", u8"Ĵ" },
        { "Jcy", u8"Й" },
        { "Jfr", u8"𝔍" },
        { "Jopf", u8"𝕁" },
        { "Jscr", u8"𝒥" },
        { "Jsercy", u8"Ј" },
        { "Jukcy", u8"Є" },
        { "KHcy", u8"Х" },
        { "KJcy", u8"Ќ" },
        { "Kappa", u8"Κ" },
        { "Kcedil", u8"Ķ" },
        { "Kcy", u8"К" },
        { "Kfr", u8"𝔎" },
        { "Kopf", u8"𝕂" },
        { "Kscr", u8"𝒦" },
        { "LJcy", u8"Љ" },
        { "LT", u8"<" },
        { "Lacute", u8"Ĺ" },
        { "Lambda", u8"Λ" },
        { "Lang", u8"⟪" },
        { "Laplacetrf", u8"ℒ" },
        { "Larr", u8"↞" },
        { "Lcaron", u8"Ľ" },
        { "Lcedil", u8"Ļ" },
        { "Lcy", u8"Л" },
        { "LeftAngleBracket", u8"⟨" },
        { "LeftArrow", u8"←" },
        { "LeftArrowBar", u8"⇤" },
        { "LeftArrowRightArrow", u8"⇆" },
        { "LeftCeiling", u8"⌈" },
        { "LeftDoubleBracket", u8"⟦" },
        { "LeftDownTeeVector", u8"⥡" },
        { "LeftDownVector", u8"⇃" },
        { "LeftDownVectorBar", u8"⥙" },
        { "LeftFloor", u8"⌊" },
        { "LeftRightArrow", u8"↔" },
        { "LeftRightVector", u8"⥎" },
        { "LeftTee", u8"⊣" },
        { "LeftTeeArrow", u8"↤" },
        { "LeftTeeVector", u8"⥚" },
        { "LeftTriangle", u8"⊲" },
        { "LeftTriangleBar", u8"⧏" },
        { "LeftTriangleEqual", u8"⊴" },
        { "LeftUpDownVector", u8"⥑" },
        { "LeftUpTeeVector", u8"⥠" },
        { "LeftUpVector", u8"↿" },
        { "LeftUpVectorBar", u8"⥘" },
        { "LeftVector", u8"↼" },
        { "LeftVectorBar", u8"⥒" },
        { "Leftarrow", u8"⇐" },
        { "Leftrightarrow", u8"⇔" },
        { "LessEqualGreater", u8"⋚" },
        { "LessFullEqual", u8"≦" },
        { "LessGreater", u8"≶" },
        { "LessLess", u8"⪡" },
        { "LessSlantEqual", u8"⩽" },
        { "LessTilde", u8"≲" },
        { "Lfr", u8"𝔏" },
        { "Ll", u8"⋘" },
        { "Lleftarrow", u8"⇚" },
        { "Lmidot", u8"Ŀ" },
        { "LongLeftArrow", u8"⟵" },
        { "LongLeftRightArrow", u8"⟷" },
        { "LongRightArrow", u8"⟶" },
        { "Longleftarrow", u8"⟸" },
        { "Longleftrightarrow", u8"⟺" },
        { "Longrightarrow", u8"⟹" },
        { "Lopf", u8"𝕃" },
        { "LowerLeftArrow", u8"↙" },
        { "LowerRightArrow", u8"↘" },
        { "Lscr", u8"ℒ" },
        { "Lsh", u8"↰" },
        { "Lstrok", u8"Ł" },
        { "Lt", u8"≪" },
        { "Map", u8"⤅" },
        { "Mcy", u8"М" },
        { "MediumSpace", u8" " },
        { "Mellintrf", u8"ℳ" },
        { "Mfr", u8"𝔐" },
        { "MinusPlus", u8"∓" },
        { "Mopf", u8"𝕄" },
        { "Mscr", u8"ℳ" },
        { "Mu", u8"Μ" },
        { "NJcy", u8"Њ" },
        { "Nacute", u8"Ń" },
        { "Ncaron", u8"Ň" },
        { "Ncedil", u8"Ņ" },
        { "Ncy", u8"Н" },
        { "NegativeMediumSpace", u8"​" },
        { "NegativeThickSpace", u8"​" },
        { "NegativeThinSpace", u8"​" },
        { "NegativeVeryThinSpace", u8"​" },
        { "NestedGreaterGreater", u8"≫" },
        { "NestedLessLess", u8"≪" },
        { "NewLine", u8"\n" },
        { "Nfr", u8"𝔑" },
        { "NoBreak", u8"⁠" },
        { "NonBreakingSpace", u8" " },
        { "Nopf", u8"ℕ" },
        { "Not", u8"⫬" },
        { "NotCongruent", u8"≢" },
        { "NotCupCap", u8"≭" },
        { "NotDoubleVerticalBar", u8"∦" },
        { "NotElement", u8"∉" },
        { "NotEqual", u8"≠" },
        { "NotEqualTilde", u8"≂̸" },
        { "NotExists", u8"∄" },
        { "NotGreater", u8"≯" },
        { "NotGreaterEqual", u8"≱" },
        { "NotGreaterFullEqual", u8"≧̸" },
        { "NotGreaterGreater", u8"≫̸" },
        { "NotGreaterLess", u8"≹" },
        { "NotGreaterSlantEqual", u8"⩾̸" },
        { "NotGreaterTilde", u8"≵" },
        { "NotHumpDownHump", u8"≎̸" },
        { "NotHumpEqual", u8"≏̸" },
        { "NotLeftTriangle", u8"⋪" },
        { "NotLeftTriangleBar", u8"⧏̸" },
        { "NotLeftTriangleEqual", u8"⋬" },
        { "NotLess", u8"≮" },
        { "NotLessEqual", u8"≰" },
        { "NotLessGreater", u8"≸" },
        { "NotLessLess", u8"≪̸" },
        { "NotLessSlantEqual", u8"⩽̸" },
        { "NotLessTilde", u8"≴" },
        { "NotNestedGreaterGreater", u8"⪢̸" },
        { "NotNestedLessLess", u8"⪡̸" },
        { "NotPrecedes", u8"⊀" },
        { "NotPrecedesEqual", u8"⪯̸" },
        { "NotPrecedesSlantEqual", u8"⋠" },
        { "NotReverseElement", u8"∌" },
        { "NotRightTriangle", u8"⋫" },
        { "NotRightTriangleBar", u8"⧐̸" },
        { "NotRightTriangleEqual", u8"⋭" },
        { "NotSquareSubset", u8"⊏̸" },
        { "NotSquareSubsetEqual", u8"⋢" },
        { "NotSquareSuperset", u8"⊐̸" },
        { "NotSquareSupersetEqual", u8"⋣" },
        { "NotSubset", u8"⊂⃒" },
        { "NotSubsetEqual", u8"⊈" },
        { "NotSucceeds", u8"⊁" },
        { "NotSucceedsEqual", u8"⪰̸" },
        { "NotSucceedsSlantEqual", u8"⋡" },
        { "NotSucceedsTilde", u8"≿̸" },
        { "NotSuperset", u8"⊃⃒" },
        { "NotSupersetEqual", u8"⊉" },
        { "NotTilde", u8"≁" },
        { "NotTildeEqual", u8"≄" },
        { "NotTildeFullEqual", u8"≇" },
        { "NotTildeTilde", u8"≉" },
        { "NotVerticalBar", u8"∤" },
        { "Nscr", u8"𝒩" },
        { "Ntilde", u8"Ñ" },
        { "Nu", u8"Ν" },
        { "OElig", u8"Œ" },
        { "Oacute", u8"Ó" },
        { "Ocirc", u8"Ô" },
        { "Ocy", u8"О" },
        { "Odblac", u8"Ő" },
        { "Ofr", u8"𝔒" },
        { "Ograve", u8"Ò" },
        { "Omacr", u8"Ō" },
        { "Omega", u8"Ω" },
        { "Omicron", u8"Ο" },
        { "Oopf", u8"𝕆" },
        { "OpenCurlyDoubleQuote", u8"“" },
        { "OpenCurlyQuote", u8"‘" },
        { "Or", u8"⩔" },
        { "Oscr", u8"𝒪" },
        { "Oslash", u8"Ø" },
        { "Otilde", u8"Õ" },
        { "Otimes", u8"⨷" },
        { "Ouml", u8"Ö" },
        { "OverBar", u8"‾" },
        { "OverBrace", u8"⏞" },
        { "OverBracket", u8"⎴" },
        { "OverParenthesis", u8"⏜" },
        { "PartialD", u8"∂" },
        { "Pcy", u8"П" },
        { "Pfr", u8"𝔓" },
        { "Phi", u8"Φ" },
        { "Pi", u8"Π" },
        { "PlusMinus", u8"±" },
        { "Poincareplane", u8"ℌ" },
        { "Popf", u8"ℙ" },
        { "Pr", u8"⪻" },
        { "Precedes", u8"≺" },
        { "PrecedesEqual", u8"⪯" },
        { "PrecedesSlantEqual", u8"≼" },
        { "PrecedesTilde", u8"≾" },
        { "Prime", u8"″" },
        { "Product", u8"∏" },
        { "Proportion", u8"∷" },
        { "Proportional", u8"∝" },
        { "Pscr", u8"𝒫" },
        { "Psi", u8"Ψ" },
        { "QUOT", u8"\"" },
        { "Qfr", u8"𝔔" },
        { "Qopf", u8"ℚ" },
        { "Qscr", u8"𝒬" },
        { "RBarr", u8"⤐" },
        { "REG", u8"®" },
        { "Racute", u8"Ŕ" },
        { "Rang", u8"⟫" },
        { "Rarr", u8"↠" },
        { "Rarrtl", u8"⤖" },
        { "Rcaron", u8"Ř" },
        { "Rcedil", u8"Ŗ" },
        { "Rcy", u8"Р" },
        { "Re", u8"ℜ" },
        { "ReverseElement", u8"∋" },
        { "ReverseEquilibrium", u8"⇋" },
        { "ReverseUpEquilibrium", u8"⥯" },
        { "Rfr", u8"ℜ" },
        { "Rho", u8"Ρ" },
        { "RightAngleBracket", u8"⟩" },
        { "RightArrow", u8"→" },
        { "RightArrowBar", u8"⇥" },
        { "RightArrowLeftArrow", u8"⇄" },
        { "RightCeiling", u8"⌉" },
        { "RightDoubleBracket", u8"⟧" },
        { "RightDownTeeVector", u8"⥝" },
        { "RightDownVector", u8"⇂" },
        { "RightDownVectorBar", u8"⥕" },
        { "RightFloor", u8"⌋" },
        { "RightTee", u8"⊢" },
        { "RightTeeArrow", u8"↦" },
        { "RightTeeVector", u8"⥛" },
        { "RightTriangle", u8"⊳" },
        { "RightTriangleBar", u8"⧐" },
        { "RightTriangleEqual", u8"⊵" },
        { "RightUpDownVector", u8"⥏" },
        { "RightUpTeeVector", u8"⥜" },
        { "RightUpVector", u8"↾" },
        { "RightUpVectorBar", u8"⥔" },
        { "RightVector", u8"⇀" },
        { "RightVectorBar", u8"⥓" },
        { "Rightarrow", u8"⇒" },
        { "Ropf", u8"ℝ" },
        { "RoundImplies", u8"⥰" },
        { "Rrightarrow", u8"⇛" },
        { "Rscr", u8"ℛ" },
        { "Rsh", u8"↱" },
        { "RuleDelayed", u8"⧴" },
        { "SHCHcy", u8"Щ" },
        { "SHcy", u8"Ш" },
        { "SOFTcy", u8"Ь" },
        { "Sacute", u8"Ś" },
        { "Sc", u8"⪼" },
        { "Scaron", u8"Š" },
        { "Scedil", u8"Ş" },
        { "Scirc", u8"Ŝ" },
        { "Scy", u8"С" },
        { "Sfr", u8"𝔖" },
        { "ShortDownArrow", u8"↓" },
        { "ShortLeftArrow", u8"←" },
        { "ShortRightArrow", u8"→" },
        { "ShortUpArrow", u8"↑" },
        { "Sigma", u8"Σ" },
        { "SmallCircle", u8"∘" },
        { "Sopf", u8"𝕊" },
        { "Sqrt", u8"√" },
        { "Square", u8"□" },
        { "SquareIntersection", u8"⊓" },
        { "SquareSubset", u8"⊏" },
        { "SquareSubsetEqual", u8"⊑" },
        { "SquareSuperset", u8"⊐" },
        { "SquareSupersetEqual", u8"⊒" },
        { "SquareUnion", u8"⊔" },
        { "Sscr", u8"𝒮" },
        { "Star", u8"⋆" },
        { "Sub", u8"⋐" },
        { "Subset", u8"⋐" },
        { "SubsetEqual", u8"⊆" },
        { "Succeeds", u8"≻" },
        { "SucceedsEqual", u8"⪰" },
        { "SucceedsSlantEqual", u8"≽" },
        { "SucceedsTilde", u8"≿" },
        { "SuchThat", u8"∋" },
        { "Sum", u8"∑" },
        { "Sup", u8"⋑" },
        { "Superset", u8"⊃" },
        { "SupersetEqual", u8"⊇" },
        { "Supset", u8"⋑" },
        { "THORN", u8"Þ" },
        { "TRADE", u8"™" },
        { "TSHcy", u8"Ћ" },
        { "TScy", u8"Ц" },
        { "Tab", u8"\t" },
        { "Tau", u8"Τ" },
        { "Tcaron", u8"Ť" },
        { "Tcedil", u8"Ţ" },
        { "Tcy", u8"Т" },
        { "Tfr", u8"𝔗" },
        { "Therefore", u8"∴" },
        { "Theta", u8"Θ" },
        { "ThickSpace", u8"  " },
        { "ThinSpace", u8" " },
        { "Tilde", u8"∼" },
        { "TildeEqual", u8"≃" },
        { "TildeFullEqual", u8"≅" },
        { "TildeTilde", u8"≈" },
        { "Topf", u8"𝕋" },
        { "TripleDot", u8"⃛" },
        { "Tscr", u8"𝒯" },
        { "Tstrok", u8"Ŧ" },
        { "Uacute", u8"Ú" },
        { "Uarr", u8"↟" },
        { "Uarrocir", u8"⥉" },
        { "Ubrcy", u8"Ў" },
        { "Ubreve", u8"Ŭ" },
        { "Ucirc", u8"Û" },
        { "Ucy", u8"У" },
        { "Udblac", u8"Ű" },
        { "Ufr", u8"𝔘" },
        { "Ugrave", u8"Ù" },
        { "Umacr", u8"Ū" },
        { "UnderBar", u8"_" },
        { "UnderBrace", u8"⏟" },
        { "UnderBracket", u8"⎵" },
        { "UnderParenthesis", u8"⏝" },
        { "Union", u8"⋃" },
        { "UnionPlus", u8"⊎" },
        { "Uogon", u8"Ų" },
        { "Uopf", u8"𝕌" },
        { "UpArrow", u8"↑" },
        { "UpArrowBar", u8"⤒" },
        { "UpArrowDownArrow", u8"⇅" },
        { "UpDownArrow", u8"↕" },
        { "UpEquilibrium", u8"⥮" },
        { "UpTee", u8"⊥" },
        { "UpTeeArrow", u8"↥" },
        { "Uparrow", u8"⇑" },
        { "Updownarrow", u8"⇕" },
        { "UpperLeftArrow", u8"↖" },
        { "UpperRightArrow", u8"↗" },
        { "Upsi", u8"ϒ" },
        { "Upsilon", u8"Υ" },
        { "Uring", u8"Ů" },
        { "Uscr", u8"𝒰" },
        { "Utilde", u8"Ũ" },
        { "Uuml", u8"Ü" },
        { "VDash", u8"⊫" },
        { "Vbar", u8"⫫" },
        { "Vcy", u8"В" },
        { "Vdash", u8"⊩" },
        { "Vdashl", u8"⫦" },
        { "Vee", u8"⋁" },
        { "Verbar", u8"‖" },
        { "Vert", u8"‖" },
        { "VerticalBar", u8"∣" },
        { "VerticalLine", u8"|" },
        { "VerticalSeparator", u8"❘" },
        { "VerticalTilde", u8"≀" },
        { "VeryThinSpace", u8" " },
        { "Vfr", u8"𝔙" },
        { "Vopf", u8"𝕍" },
        { "Vscr", u8"𝒱" },
        { "Vvdash", u8"⊪" },
        { "Wcirc", u8"Ŵ" },
        { "Wedge", u8"⋀" },
        { "Wfr", u8"𝔚" },
        { "Wopf", u8"𝕎" },
        { "Wscr", u8"𝒲" },
        { "Xfr", u8"𝔛" },
        { "Xi", u8"Ξ" },
        { "Xopf", u8"𝕏" },
        { "Xscr", u8"𝒳" },
        { "YAcy", u8"Я" },
        { "YIcy", u8"Ї" },
        { "YUcy", u8"Ю" },
        { "Yacute", u8"Ý" },
        { "Ycirc", u8"Ŷ" },
        { "Ycy", u8"Ы" },
        { "Yfr", u8"𝔜" },
        { "Yopf", u8"𝕐" },
        { "Yscr", u8"𝒴" },
        { "Yuml", u8"Ÿ" },
        { "ZHcy", u8"Ж" },
        { "Zacute", u8"Ź" },
        { "Zcaron", u8"Ž" },
        { "Zcy", u8"З" },
        { "Zdot", u8"Ż" },
        { "ZeroWidthSpace", u8"​" },
        { "Zeta", u8"Ζ" },
        { "Zfr", u8"ℨ" },
        { "Zopf", u8"ℤ" },
        { "Zscr", u8"𝒵" },
        { "aacute", u8"á" },
        { "abreve", u8"ă" },
        { "ac", u8"∾" },
        { "acE", u8"∾̳" },
        { "acd", u8"∿" },
        { "acirc", u8"â" },
        { "acute", u8"´" },
        { "acy", u8"а" },
        { "aelig", u8"æ" },
        { "af", u8"⁡" },
        { "afr", u8"𝔞" },
        { "agrave", u8"à" },
        { "alefsym", u8"ℵ" },
        { "aleph", u8"ℵ" },
        { "alpha", u8"α" },
        { "amacr", u8"ā" },
        { "amalg", u8"⨿" },
        { "amp", u8"&" },
        { "and", u8"∧" },
        { "andand", u8"⩕" },
        { "andd", u8"⩜" },
        { "andslope", u8"⩘" },
        { "andv", u8"⩚" },
        { "ang", u8"∠" },
        { "ange", u8"⦤" },
        { "angle", u8"∠" },
        { "angmsd", u8"∡" },
        { "angmsdaa", u8"⦨" },
        { "angmsdab", u8"⦩" },
        { "angmsdac", u8"⦪" },
        { "angmsdad", u8"⦫" },
        { "angmsdae", u8"⦬" },
        { "angmsdaf", u8"⦭" },
        { "angmsdag", u8"⦮" },
        { "angmsdah", u8"⦯" },
        { "angrt", u8"∟" },
        { "angrtvb", u8"⊾" },
        { "angrtvbd", u8"⦝" },
        { "angsph", u8"∢" },
        { "angst", u8"Å" },
        { "angzarr", u8"⍼" },
        { "aogon", u8"ą" },
        { "aopf", u8"𝕒" },
        { "ap", u8"≈" },
        { "apE", u8"⩰" },
        { "apacir", u8"⩯" },
        { "ape", u8"≊" },
        { "apid", u8"≋" },
        { "apos", u8"'" },
        { "approx", u8"≈" },
        { "approxeq", u8"≊" },
        { "aring", u8"å" },
        { "ascr", u8"𝒶" },
        { "ast", u8"*" },
        { "asymp", u8"≈" },
        { "asympeq", u8"≍" },
        { "atilde", u8"ã" },
        { "auml", u8"ä" },
        { "awconint", u8"∳" },
        { "awint", u8"⨑" },
        { "bNot", u8"⫭" },
        { "backcong", u8"≌" },
        { "backepsilon", u8"϶" },
        { "backprime", u8"‵" },
        { "backsim", u8"∽" },
        { "backsimeq", u8"⋍" },
        { "barvee", u8"⊽" },
        { "barwed", u8"⌅" },
        { "barwedge", u8"⌅" },
        { "bbrk", u8"⎵" },
        { "bbrktbrk", u8"⎶" },
        { "bcong", u8"≌" },
        { "bcy", u8"б" },
        { "bdquo", u8"„" },
        { "becaus", u8"∵" },
        { "because", u8"∵" },
        { "bemptyv", u8"⦰" },
        { "bepsi", u8"϶" },
        { "bernou", u8"ℬ" },
        { "beta", u8"β" },
        { "beth", u8"ℶ" },
        { "between", u8"≬" },
        { "bfr", u8"𝔟" },
        { "bigcap", u8"⋂" },
        { "bigcirc", u8"◯" },
        { "bigcup", u8"⋃" },
        { "bigodot", u8"⨀" },
        { "bigoplus", u8"⨁" },
        { "bigotimes", u8"⨂" },
        { "bigsqcup", u8"⨆" },
        { "bigstar", u8"★" },
        { "bigtriangledown", u8"▽" },
        { "bigtriangleup", u8"△" },
        { "biguplus", u8"⨄" },
        { "bigvee", u8"⋁" },
        { "bigwedge", u8"⋀" },
        { "bkarow", u8"⤍" },
        { "blacklozenge", u8"⧫" },
        { "blacksquare", u8"▪" },
        { "blacktriangle", u8"▴" },
        { "blacktriangledown", u8"▾" },
        { "blacktriangleleft", u8"◂" },
        { "blacktriangleright", u8"▸" },
        { "blank", u8"␣" },
        { "blk12", u8"▒" },
        { "blk14", u8"░" },
        { "blk34", u8"▓" },
        { "block", u8"█" },
        { "bne", u8"=⃥" },
        { "bnequiv", u8"≡⃥" },
        { "bnot", u8"⌐" },
        { "bopf", u8"𝕓" },
        { "bot", u8"⊥" },
        { "bottom", u8"⊥" },
        { "bowtie", u8"⋈" },
        { "boxDL", u8"╗" },
        { "boxDR", u8"╔" },
        { "boxDl", u8"╖" },
        { "boxDr", u8"╓" },
        { "boxH", u8"═" },
        { "boxHD", u8"╦" },
        { "boxHU", u8"╩" },
        { "boxHd", u8"╤" },
        { "boxHu", u8"╧" },
        { "boxUL", u8"╝" },
        { "boxUR", u8"╚" },
        { "boxUl", u8"╜" },
        { "boxUr", u8"╙" },
        { "boxV", u8"║" },
        { "boxVH", u8"╬" },
        { "boxVL", u8"╣" },
        { "boxVR", u8"╠" },
        { "boxVh", u8"╫" },
        { "boxVl", u8"╢" },
        { "boxVr", u8"╟" },
        { "boxbox", u8"⧉" },
        { "boxdL", u8"╕" },
        { "boxdR", u8"╒" },
        { "boxdl", u8"┐" },
        { "boxdr", u8"┌" },
        { "boxh", u8"─" },
        { "boxhD", u8"╥" },
        { "boxhU", u8"╨" },
        { "boxhd", u8"┬" },
        { "boxhu", u8"┴" },
        { "boxminus", u8"⊟" },
        { "boxplus", u8"⊞" },
        { "boxtimes", u8"⊠" },
        { "boxuL", u8"╛" },
        { "boxuR", u8"╘" },
        { "boxul", u8"┘" },
        { "boxur", u8"└" },
        { "boxv", u8"│" },
        { "boxvH", u8"╪" },
        { "boxvL", u8"╡" },
        { "boxvR", u8"╞" },
        { "boxvh", u8"┼" },
        { "boxvl", u8"┤" },
        { "boxvr", u8"├" },
        { "bprime", u8"‵" },
        { "breve", u8"˘" },
        { "brvbar", u8"¦" },
        { "bscr", u8"𝒷" },
        { "bsemi", u8"⁏" },
        { "bsim", u8"∽" },
        { "bsime", u8"⋍" },
        { "bsol", u8"\\" },
        { "bsolb", u8"⧅" },
        { "bsolhsub", u8"⟈" },
        { "bull", u8"•" },
        { "bullet", u8"•" },
        { "bump", u8"≎" },
        { "bumpE", u8"⪮" },
        { "bumpe", u8"≏" },
        { "bumpeq", u8"≏" },
        { "cacute", u8"ć" },
        { "cap", u8"∩" },
        { "capand", u8"⩄" },
        { "capbrcup", u8"⩉" },
        { "capcap", u8"⩋" },
        { "capcup", u8"⩇" },
        { "capdot", u8"⩀" },
        { "caps", u8"∩︀" },
        { "caret", u8"⁁" },
        { "caron", u8"ˇ" },
        { "ccaps", u8"⩍" },
        { "ccaron", u8"č" },
        { "ccedil", u8"ç" },
        { "ccirc", u8"ĉ" },
        { "ccups", u8"⩌" },
        { "ccupssm", u8"⩐" },
        { "cdot", u8"ċ" },
        { "cedil", u8"¸" },
        { "cemptyv", u8"⦲" },
        { "cent", u8"¢" },
        { "centerdot", u8"·" },
        { "cfr", u8"𝔠" },
        { "chcy", u8"ч" },
        { "check", u8"✓" },
        { "checkmark", u8"✓" },
        { "chi", u8"χ" },
        { "cir", u8"○" },
        { "cirE", u8"⧃" },
        { "circ", u8"ˆ" },
        { "circeq", u8"≗" },
        { "circlearrowleft", u8"↺" },
        { "circlearrowright", u8"↻" },
        { "circledR", u8"®" },
        { "circledS", u8"Ⓢ" },
        { "circledast", u8"⊛" },
        { "circledcirc", u8"⊚" },
        { "circleddash", u8"⊝" },
        { "cire", u8"≗" },
        { "cirfnint", u8"⨐" },
        { "cirmid", u8"⫯" },
        { "cirscir", u8"⧂" },
        { "clubs", u8"♣" },
        { "clubsuit", u8"♣" },
        { "colon", u8":" },
        { "colone", u8"≔" },
        { "coloneq", u8"≔" },
        { "comma", u8"," },
        { "commat", u8"@" },
        { "comp", u8"∁" },
        { "compfn", u8"∘" },
        { "complement", u8"∁" },
        { "complexes", u8"ℂ" },
        { "cong", u8"≅" },
        { "congdot", u8"⩭" },
        { "conint", u8"∮" },
        { "copf", u8"𝕔" },
        { "coprod", u8"∐" },
        { "copy", u8"©" },
        { "copysr", u8"℗" },
        { "crarr", u8"↵" },
        { "cross", u8"✗" },
        { "cscr", u8"𝒸" },
        { "csub", u8"⫏" },
        { "csube", u8"⫑" },
        { "csup", u8"⫐" },
        { "csupe", u8"⫒" },
        { "ctdot", u8"⋯" },
        { "cudarrl", u8"⤸" },
        { "cudarrr", u8"⤵" },
        { "cuepr", u8"⋞" },
        { "cuesc", u8"⋟" },
        { "cularr", u8"↶" },
        { "cularrp", u8"⤽" },
        { "cup", u8"∪" },
        { "cupbrcap", u8"⩈" },
        { "cupcap", u8"⩆" },
        { "cupcup", u8"⩊" },
        { "cupdot", u8"⊍" },
        { "cupor", u8"⩅" },
        { "cups", u8"∪︀" },
        { "curarr", u8"↷" },
        { "curarrm", u8"⤼" },
        { "curlyeqprec", u8"⋞" },
        { "curlyeqsucc", u8"⋟" },
        { "curlyvee", u8"⋎" },
        { "curlywedge", u8"⋏" },
        { "curren", u8"¤" },
        { "curvearrowleft", u8"↶" },
        { "curvearrowright", u8"↷" },
        { "cuvee", u8"⋎" },
        { "cuwed", u8"⋏" },
        { "cwconint", u8"∲" },
        { "cwint", u8"∱" },
        { "cylcty", u8"⌭" },
        { "dArr", u8"⇓" },
        { "dHar", u8"⥥" },
        { "dagger", u8"†" },
        { "daleth", u8"ℸ" },
        { "darr", u8"↓" },
        { "dash", u8"‐" },
        { "dashv", u8"⊣" },
        { "dbkarow", u8"⤏" },
        { "dblac", u8"˝" },
        { "dcaron", u8"ď" },
        { "dcy", u8"д" },
        { "dd", u8"ⅆ" },
        { "ddagger", u8"‡" },
        { "ddarr", u8"⇊" },
        { "ddotseq", u8"⩷" },
        { "deg", u8"°" },
        { "delta", u8"δ" },
        { "demptyv", u8"⦱" },
        { "dfisht", u8"⥿" },
        { "dfr", u8"𝔡" },
        { "dharl", u8"⇃" },
        { "dharr", u8"⇂" },
        { "diam", u8"⋄" },
        { "diamond", u8"⋄" },
        { "diamondsuit", u8"♦" },
        { "diams", u8"♦" },
        { "die", u8"¨" },
        { "digamma", u8"ϝ" },
        { "disin", u8"⋲" },
        { "div", u8"÷" },
        { "divide", u8"÷" },
        { "divideontimes", u8"⋇" },
        { "divonx", u8"⋇" },
        { "djcy", u8"ђ" },
        { "dlcorn", u8"⌞" },
        { "dlcrop", u8"⌍" },
        { "dollar", u8"$" },
        { "dopf", u8"𝕕" },
        { "dot", u8"˙" },
        { "doteq", u8"≐" },
        { "doteqdot", u8"≑" },
        { "dotminus", u8"∸" },
        { "dotplus", u8"∔" },
        { "dotsquare", u8"⊡" },
        { "doublebarwedge", u8"⌆" },
        { "downarrow", u8"↓" },
        { "downdownarrows", u8"⇊" },
        { "downharpoonleft", u8"⇃" },
        { "downharpoonright", u8"⇂" },
        { "drbkarow", u8"⤐" },
        { "drcorn", u8"⌟" },
        { "drcrop", u8"⌌" },
        { "dscr", u8"𝒹" },
        { "dscy", u8"ѕ" },
        { "dsol", u8"⧶" },
        { "dstrok", u8"đ" },
        { "dtdot", u8"⋱" },
        { "dtri", u8"▿" },
        { "dtrif", u8"▾" },
        { "duarr", u8"⇵" },
        { "duhar", u8"⥯" },
        { "dwangle", u8"⦦" },
        { "dzcy", u8"џ" },
        { "dzigrarr", u8"⟿" },
        { "eDDot", u8"⩷" },
        { "eDot", u8"≑" },
        { "eacute", u8"é" },
        { "easter", u8"⩮" },
        { "ecaron", u8"ě" },
        { "ecir", u8"≖" },
        { "ecirc", u8"ê" },
        { "ecolon", u8"≕" },
        { "ecy", u8"э" },
        { "edot", u8"ė" },
        { "ee", u8"ⅇ" },
        { "efDot", u8"≒" },
        { "efr", u8"𝔢" },
        { "eg", u8"⪚" },
        { "egrave", u8"è" },
        { "egs", u8"⪖" },
        { "egsdot", u8"⪘" },
        { "el", u8"⪙" },
        { "elinters", u8"⏧" },
        { "ell", u8"ℓ" },
        { "els", u8"⪕" },
        { "elsdot", u8"⪗" },
        { "emacr", u8"ē" },
        { "empty", u8"∅" },
        { "emptyset", u8"∅" },
        { "emptyv", u8"∅" },
        { "emsp13", u8" " },
        { "emsp14", u8" " },
        { "emsp", u8" " },
        { "eng", u8"ŋ" },
        { "ensp", u8" " },
        { "eogon", u8"ę" },
        { "eopf", u8"𝕖" },
        { "epar", u8"⋕" },
        { "eparsl", u8"⧣" },
        { "eplus", u8"⩱" },
        { "epsi", u8"ε" },
        { "epsilon", u8"ε" },
        { "epsiv", u8"ϵ" },
        { "eqcirc", u8"≖" },
        { "eqcolon", u8"≕" },
        { "eqsim", u8"≂" },
        { "eqslantgtr", u8"⪖" },
        { "eqslantless", u8"⪕" },
        { "equals", u8"=" },
        { "equest", u8"≟" },
        { "equiv", u8"≡" },
        { "equivDD", u8"⩸" },
        { "eqvparsl", u8"⧥" },
        { "erDot", u8"≓" },
        { "erarr", u8"⥱" },
        { "escr", u8"ℯ" },
        { "esdot", u8"≐" },
        { "esim", u8"≂" },
        { "eta", u8"η" },
        { "eth", u8"ð" },
        { "euml", u8"ë" },
        { "euro", u8"€" },
        { "excl", u8"!" },
        { "exist", u8"∃" },
        { "expectation", u8"ℰ" },
        { "exponentiale", u8"ⅇ" },
        { "fallingdotseq", u8"≒" },
        { "fcy", u8"ф" },
        { "female", u8"♀" },
        { "ffilig", u8"ffi" },
        { "fflig", u8"ff" },
        { "ffllig", u8"ffl" },
        { "ffr", u8"𝔣" },
        { "filig", u8"fi" },
        { "fjlig", u8"fj" },
        { "flat", u8"♭" },
        { "fllig", u8"fl" },
        { "fltns", u8"▱" },
        { "fnof", u8"ƒ" },
        { "fopf", u8"𝕗" },
        { "forall", u8"∀" },
        { "fork", u8"⋔" },
        { "forkv", u8"⫙" },
        { "fpartint", u8"⨍" },
        { "frac12", u8"½" },
        { "frac13", u8"⅓" },
        { "frac14", u8"¼" },
        { "frac15", u8"⅕" },
        { "frac16", u8"⅙" },
        { "frac18", u8"⅛" },
        { "frac23", u8"⅔" },
        { "frac25", u8"⅖" },
        { "frac34", u8"¾" },
        { "frac35", u8"⅗" },
        { "frac38", u8"⅜" },
        { "frac45", u8"⅘" },
        { "frac56", u8"⅚" },
        { "frac58", u8"⅝" },
        { "frac78", u8"⅞" },
        { "frasl", u8"⁄" },
        { "frown", u8"⌢" },
        { "fscr", u8"𝒻" },
        { "gE", u8"≧" },
        { "gEl", u8"⪌" },
        { "gacute", u8"ǵ" },
        { "gamma", u8"γ" },
        { "gammad", u8"ϝ" },
        { "gap", u8"⪆" },
        { "gbreve", u8"ğ" },
        { "gcirc", u8"ĝ" },
        { "gcy", u8"г" },
        { "gdot", u8"ġ" },
        { "ge", u8"≥" },
        { "gel", u8"⋛" },
        { "geq", u8"≥" },
        { "geqq", u8"≧" },
        { "geqslant", u8"⩾" },
        { "ges", u8"⩾" },
        { "gescc", u8"⪩" },
        { "gesdot", u8"⪀" },
        { "gesdoto", u8"⪂" },
        { "gesdotol", u8"⪄" },
        { "gesl", u8"⋛︀" },
        { "gesles", u8"⪔" },
        { "gfr", u8"𝔤" },
        { "gg", u8"≫" },
        { "ggg", u8"⋙" },
        { "gimel", u8"ℷ" },
        { "gjcy", u8"ѓ" },
        { "gl", u8"≷" },
        { "glE", u8"⪒" },
        { "gla", u8"⪥" },
        { "glj", u8"⪤" },
        { "gnE", u8"≩" },
        { "gnap", u8"⪊" },
        { "gnapprox", u8"⪊" },
        { "gne", u8"⪈" },
        { "gneq", u8"⪈" },
        { "gneqq", u8"≩" },
        { "gnsim", u8"⋧" },
        { "gopf", u8"𝕘" },
        { "grave", u8"`" },
        { "gscr", u8"ℊ" },
        { "gsim", u8"≳" },
        { "gsime", u8"⪎" },
        { "gsiml", u8"⪐" },
        { "gt", u8">" },
        { "gtcc", u8"⪧" },
        { "gtcir", u8"⩺" },
        { "gtdot", u8"⋗" },
        { "gtlPar", u8"⦕" },
        { "gtquest", u8"⩼" },
        { "gtrapprox", u8"⪆" },
        { "gtrarr", u8"⥸" },
        { "gtrdot", u8"⋗" },
        { "gtreqless", u8"⋛" },
        { "gtreqqless", u8"⪌" },
        { "gtrless", u8"≷" },
        { "gtrsim", u8"≳" },
        { "gvertneqq", u8"≩︀" },
        { "gvnE", u8"≩︀" },
        { "hArr", u8"⇔" },
        { "hairsp", u8" " },
        { "half", u8"½" },
        { "hamilt", u8"ℋ" },
        { "hardcy", u8"ъ" },
        { "harr", u8"↔" },
        { "harrcir", u8"⥈" },
        { "harrw", u8"↭" },
        { "hbar", u8"ℏ" },
        { "hcirc", u8"ĥ" },
        { "hearts", u8"♥" },
        { "heartsuit", u8"♥" },
        { "hellip", u8"…" },
        { "hercon", u8"⊹" },
        { "hfr", u8"𝔥" },
        { "hksearow", u8"⤥" },
        { "hkswarow", u8"⤦" },
        { "hoarr", u8"⇿" },
        { "homtht", u8"∻" },
        { "hookleftarrow", u8"↩" },
        { "hookrightarrow", u8"↪" },
        { "hopf", u8"𝕙" },
        { "horbar", u8"―" },
        { "hscr", u8"𝒽" },
        { "hslash", u8"ℏ" },
        { "hstrok", u8"ħ" },
        { "hybull", u8"⁃" },
        { "hyphen", u8"‐" },
        { "iacute", u8"í" },
        { "ic", u8"⁣" },
        { "icirc", u8"î" },
        { "icy", u8"и" },
        { "iecy", u8"е" },
        { "iexcl", u8"¡" },
        { "iff", u8"⇔" },
        { "ifr", u8"𝔦" },
        { "igrave", u8"ì" },
        { "ii", u8"ⅈ" },
        { "iiiint", u8"⨌" },
        { "iiint", u8"∭" },
        { "iinfin", u8"⧜" },
        { "iiota", u8"℩" },
        { "ijlig", u8"ij" },
        { "imacr", u8"ī" },
        { "image", u8"ℑ" },
        { "imagline", u8"ℐ" },
        { "imagpart", u8"ℑ" },
        { "imath", u8"ı" },
        { "imof", u8"⊷" },
        { "imped", u8"Ƶ" },
        { "in", u8"∈" },
        { "incare", u8"℅" },
        { "infin", u8"∞" },
        { "infintie", u8"⧝" },
        { "inodot", u8"ı" },
        { "int", u8"∫" },
        { "intcal", u8"⊺" },
        { "integers", u8"ℤ" },
        { "intercal", u8"⊺" },
        { "intlarhk", u8"⨗" },
        { "intprod", u8"⨼" },
        { "iocy", u8"ё" },
        { "iogon", u8"į" },
        { "iopf", u8"𝕚" },
        { "iota", u8"ι" },
        { "iprod", u8"⨼" },
        { "iquest", u8"¿" },
        { "iscr", u8"𝒾" },
        { "isin", u8"∈" },
        { "isinE", u8"⋹" },
        { "isindot", u8"⋵" },
        { "isins", u8"⋴" },
        { "isinsv", u8"⋳" },
        { "isinv", u8"∈" },
        { "it", u8"⁢" },
        { "itilde", u8"ĩ" },
        { "iukcy", u8"і" },
        { "iuml", u8"ï" },
        { "jcirc", u8"ĵ" },
        { "jcy", u8"й" },
        { "jfr", u8"𝔧" },
        { "jmath", u8"ȷ" },
        { "jopf", u8"𝕛" },
        { "jscr", u8"𝒿" },
        { "jsercy", u8"ј" },
        { "jukcy", u8"є" },
        { "kappa", u8"κ" },
        { "kappav", u8"ϰ" },
        { "kcedil", u8"ķ" },
        { "kcy", u8"к" },
        { "kfr", u8"𝔨" },
        { "kgreen", u8"ĸ" },
        { "khcy", u8"х" },
        { "kjcy", u8"ќ" },
        { "kopf", u8"𝕜" },
        { "kscr", u8"𝓀" },
        { "lAarr", u8"⇚" },
        { "lArr", u8"⇐" },
        { "lAtail", u8"⤛" },
        { "lBarr", u8"⤎" },
        { "lE", u8"≦" },
        { "lEg", u8"⪋" },
        { "lHar", u8"⥢" },
        { "lacute", u8"ĺ" },
        { "laemptyv", u8"⦴" },
        { "lagran", u8"ℒ" },
        { "lambda", u8"λ" },
        { "lang", u8"⟨" },
        { "langd", u8"⦑" },
        { "langle", u8"⟨" },
        { "lap", u8"⪅" },
        { "laquo", u8"«" },
        { "larr", u8"←" },
        { "larrb", u8"⇤" },
        { "larrbfs", u8"⤟" },
        { "larrfs", u8"⤝" },
        { "larrhk", u8"↩" },
        { "larrlp", u8"↫" },
        { "larrpl", u8"⤹" },
        { "larrsim", u8"⥳" },
        { "larrtl", u8"↢" },
        { "lat", u8"⪫" },
        { "latail", u8"⤙" },
        { "late", u8"⪭" },
        { "lates", u8"⪭︀" },
        { "lbarr", u8"⤌" },
        { "lbbrk", u8"❲" },
        { "lbrace", u8"{" },
        { "lbrack", u8"[" },
        { "lbrke", u8"⦋" },
        { "lbrksld", u8"⦏" },
        { "lbrkslu", u8"⦍" },
        { "lcaron", u8"ľ" },
        { "lcedil", u8"ļ" },
        { "lceil", u8"⌈" },
        { "lcub", u8"{" },
        { "lcy", u8"л" },
        { "ldca", u8"⤶" },
        { "ldquo", u8"“" },
        { "ldquor", u8"„" },
        { "ldrdhar", u8"⥧" },
        { "ldrushar", u8"⥋" },
        { "ldsh", u8"↲" },
        { "le", u8"≤" },
        { "leftarrow", u8"←" },
        { "leftarrowtail", u8"↢" },
        { "leftharpoondown", u8"↽" },
        { "leftharpoonup", u8"↼" },
        { "leftleftarrows", u8"⇇" },
        { "leftrightarrow", u8"↔" },
        { "leftrightarrows", u8"⇆" },
        { "leftrightharpoons", u8"⇋" },
        { "leftrightsquigarrow", u8"↭" },
        { "leftthreetimes", u8"⋋" },
        { "leg", u8"⋚" },
        { "leq", u8"≤" },
        { "leqq", u8"≦" },
        { "leqslant", u8"⩽" },
        { "les", u8"⩽" },
        { "lescc", u8"⪨" },
        { "lesdot", u8"⩿" },
        { "lesdoto", u8"⪁" },
        { "lesdotor", u8"⪃" },
        { "lesg", u8"⋚︀" },
        { "lesges", u8"⪓" },
        { "lessapprox", u8"⪅" },
        { "lessdot", u8"⋖" },
        { "lesseqgtr", u8"⋚" },
        { "lesseqqgtr", u8"⪋" },
        { "lessgtr", u8"≶" },
        { "lesssim", u8"≲" },
        { "lfisht", u8"⥼" },
        { "lfloor", u8"⌊" },
        { "lfr", u8"𝔩" },
        { "lg", u8"≶" },
        { "lgE", u8"⪑" },
        { "lhard", u8"↽" },
        { "lharu", u8"↼" },
        { "lharul", u8"⥪" },
        { "lhblk", u8"▄" },
        { "ljcy", u8"љ" },
        { "ll", u8"≪" },
        { "llarr", u8"⇇" },
        { "llcorner", u8"⌞" },
        { "llhard", u8"⥫" },
        { "lltri", u8"◺" },
        { "lmidot", u8"ŀ" },
        { "lmoust", u8"⎰" },
        { "lmoustache", u8"⎰" },
        { "lnE", u8"≨" },
        { "lnap", u8"⪉" },
        { "lnapprox", u8"⪉" },
        { "lne", u8"⪇" },
        { "lneq", u8"⪇" },
        { "lneqq", u8"≨" },
        { "lnsim", u8"⋦" },
        { "loang", u8"⟬" },
        { "loarr", u8"⇽" },
        { "lobrk", u8"⟦" },
        { "longleftarrow", u8"⟵" },
        { "longleftrightarrow", u8"⟷" },
        { "longmapsto", u8"⟼" },
        { "longrightarrow", u8"⟶" },
        { "looparrowleft", u8"↫" },
        { "looparrowright", u8"↬" },
        { "lopar", u8"⦅" },
        { "lopf", u8"𝕝" },
        { "loplus", u8"⨭" },
        { "lotimes", u8"⨴" },
        { "lowast", u8"∗" },
        { "lowbar", u8"_" },
        { "loz", u8"◊" },
        { "lozenge", u8"◊" },
        { "lozf", u8"⧫" },
        { "lpar", u8"(" },
        { "lparlt", u8"⦓" },
        { "lrarr", u8"⇆" },
        { "lrcorner", u8"⌟" },
        { "lrhar", u8"⇋" },
        { "lrhard", u8"⥭" },
        { "lrm", u8"‎" },
        { "lrtri", u8"⊿" },
        { "lsaquo", u8"‹" },
        { "lscr", u8"𝓁" },
        { "lsh", u8"↰" },
        { "lsim", u8"≲" },
        { "lsime", u8"⪍" },
        { "lsimg", u8"⪏" },
        { "lsqb", u8"[" },
        { "lsquo", u8"‘" },
        { "lsquor", u8"‚" },
        { "lstrok", u8"ł" },
        { "lt", u8"<" },
        { "ltcc", u8"⪦" },
        { "ltcir", u8"⩹" },
        { "ltdot", u8"⋖" },
        { "lthree", u8"⋋" },
        { "ltimes", u8"⋉" },
        { "ltlarr", u8"⥶" },
        { "ltquest", u8"⩻" },
        { "ltrPar", u8"⦖" },
        { "ltri", u8"◃" },
        { "ltrie", u8"⊴" },
        { "ltrif", u8"◂" },
        { "lurdshar", u8"⥊" },
        { "luruhar", u8"⥦" },
        { "lvertneqq", u8"≨︀" },
        { "lvnE", u8"≨︀" },
        { "mDDot", u8"∺" },
        { "macr", u8"¯" },
        { "male", u8"♂" },
        { "malt", u8"✠" },
        { "maltese", u8"✠" },
        { "map", u8"↦" },
        { "mapsto", u8"↦" },
        { "mapstodown", u8"↧" },
        { "mapstoleft", u8"↤" },
        { "mapstoup", u8"↥" },
        { "marker", u8"▮" },
        { "mcomma", u8"⨩" },
        { "mcy", u8"м" },
        { "mdash", u8"—" },
        { "measuredangle", u8"∡" },
        { "mfr", u8"𝔪" },
        { "mho", u8"℧" },
        { "micro", u8"µ" },
        { "mid", u8"∣" },
        { "midast", u8"*" },
        { "midcir", u8"⫰" },
        { "middot", u8"·" },
        { "minus", u8"−" },
        { "minusb", u8"⊟" },
        { "minusd", u8"∸" },
        { "minusdu", u8"⨪" },
        { "mlcp", u8"⫛" },
        { "mldr", u8"…" },
        { "mnplus", u8"∓" },
        { "models", u8"⊧" },
        { "mopf", u8"𝕞" },
        { "mp", u8"∓" },
        { "mscr", u8"𝓂" },
        { "mstpos", u8"∾" },
        { "mu", u8"μ" },
        { "multimap", u8"⊸" },
        { "mumap", u8"⊸" },
        { "nGg", u8"⋙̸" },
        { "nGt", u8"≫⃒" },
        { "nGtv", u8"≫̸" },
        { "nLeftarrow", u8"⇍" },
        { "nLeftrightarrow", u8"⇎" },
        { "nLl", u8"⋘̸" },
        { "nLt", u8"≪⃒" },
        { "nLtv", u8"≪̸" },
        { "nRightarrow", u8"⇏" },
        { "nVDash", u8"⊯" },
        { "nVdash", u8"⊮" },
        { "nabla", u8"∇" },
        { "nacute", u8"ń" },
        { "nang", u8"∠⃒" },
        { "nap", u8"≉" },
        { "napE", u8"⩰̸" },
        { "napid", u8"≋̸" },
        { "napos", u8"ʼn" },
        { "napprox", u8"≉" },
        { "natur", u8"♮" },
        { "natural", u8"♮" },
        { "naturals", u8"ℕ" },
        { "nbsp", u8" " },
        { "nbump", u8"≎̸" },
        { "nbumpe", u8"≏̸" },
        { "ncap", u8"⩃" },
        { "ncaron", u8"ň" },
        { "ncedil", u8"ņ" },
        { "ncong", u8"≇" },
        { "ncongdot", u8"⩭̸" },
        { "ncup", u8"⩂" },
        { "ncy", u8"н" },
        { "ndash", u8"–" },
        { "ne", u8"≠" },
        { "neArr", u8"⇗" },
        { "nearhk", u8"⤤" },
        { "nearr", u8"↗" },
        { "nearrow", u8"↗" },
        { "nedot", u8"≐̸" },
        { "nequiv", u8"≢" },
        { "nesear", u8"⤨" },
        { "nesim", u8"≂̸" },
        { "nexist", u8"∄" },
        { "nexists", u8"∄" },
        { "nfr", u8"𝔫" },
        { "ngE", u8"≧̸" },
        { "nge", u8"≱" },
        { "ngeq", u8"≱" },
        { "ngeqq", u8"≧̸" },
        { "ngeqslant", u8"⩾̸" },
        { "nges", u8"⩾̸" },
        { "ngsim", u8"≵" },
        { "ngt", u8"≯" },
        { "ngtr", u8"≯" },
        { "nhArr", u8"⇎" },
        { "nharr", u8"↮" },
        { "nhpar", u8"⫲" },
        { "ni", u8"∋" },
        { "nis", u8"⋼" },
        { "nisd", u8"⋺" },
        { "niv", u8"∋" },
        { "njcy", u8"њ" },
        { "nlArr", u8"⇍" },
        { "nlE", u8"≦̸" },
        { "nlarr", u8"↚" },
        { "nldr", u8"‥" },
        { "nle", u8"≰" },
        { "nleftarrow", u8"↚" },
        { "nleftrightarrow", u8"↮" },
        { "nleq", u8"≰" },
        { "nleqq", u8"≦̸" },
        { "nleqslant", u8"⩽̸" },
        { "nles", u8"⩽̸" },
        { "nless", u8"≮" },
        { "nlsim", u8"≴" },
        { "nlt", u8"≮" },
        { "nltri", u8"⋪" },
        { "nltrie", u8"⋬" },
        { "nmid", u8"∤" },
        { "nopf", u8"𝕟" },
        { "not", u8"¬" },
        { "notin", u8"∉" },
        { "notinE", u8"⋹̸" },
        { "notindot", u8"⋵̸" },
        { "notinva", u8"∉" },
        { "notinvb", u8"⋷" },
        { "notinvc", u8"⋶" },
        { "notni", u8"∌" },
        { "notniva", u8"∌" },
        { "notnivb", u8"⋾" },
        { "notnivc", u8"⋽" },
        { "npar", u8"∦" },
        { "nparallel", u8"∦" },
        { "nparsl", u8"⫽⃥" },
        { "npart", u8"∂̸" },
        { "npolint", u8"⨔" },
        { "npr", u8"⊀" },
        { "nprcue", u8"⋠" },
        { "npre", u8"⪯̸" },
        { "nprec", u8"⊀" },
        { "npreceq", u8"⪯̸" },
        { "nrArr", u8"⇏" },
        { "nrarr", u8"↛" },
        { "nrarrc", u8"⤳̸" },
        { "nrarrw", u8"↝̸" },
        { "nrightarrow", u8"↛" },
        { "nrtri", u8"⋫" },
        { "nrtrie", u8"⋭" },
        { "nsc", u8"⊁" },
        { "nsccue", u8"⋡" },
        { "nsce", u8"⪰̸" },
        { "nscr", u8"𝓃" },
        { "nshortmid", u8"∤" },
        { "nshortparallel", u8"∦" },
        { "nsim", u8"≁" },
        { "nsime", u8"≄" },
        { "nsimeq", u8"≄" },
        { "nsmid", u8"∤" },
        { "nspar", u8"∦" },
        { "nsqsube", u8"⋢" },
        { "nsqsupe", u8"⋣" },
        { "nsub", u8"⊄" },
        { "nsubE", u8"⫅̸" },
        { "nsube", u8"⊈" },
        { "nsubset", u8"⊂⃒" },
        { "nsubseteq", u8"⊈" },
        { "nsubseteqq", u8"⫅̸" },
        { "nsucc", u8"⊁" },
        { "nsucceq", u8"⪰̸" },
        { "nsup", u8"⊅" },
        { "nsupE", u8"⫆̸" },
        { "nsupe", u8"⊉" },
        { "nsupset", u8"⊃⃒" },
        { "nsupseteq", u8"⊉" },
        { "nsupseteqq", u8"⫆̸" },
        { "ntgl", u8"≹" },
        { "ntilde", u8"ñ" },
        { "ntlg", u8"≸" },
        { "ntriangleleft", u8"⋪" },
        { "ntrianglelefteq", u8"⋬" },
        { "ntriangleright", u8"⋫" },
        { "ntrianglerighteq", u8"⋭" },
        { "nu", u8"ν" },
        { "num", u8"#" },
        { "numero", u8"№" },
        { "numsp", u8" " },
        { "nvDash", u8"⊭" },
        { "nvHarr", u8"⤄" },
        { "nvap", u8"≍⃒" },
        { "nvdash", u8"⊬" },
        { "nvge", u8"≥⃒" },
        { "nvgt", u8">⃒" },
        { "nvinfin", u8"⧞" },
        { "nvlArr", u8"⤂" },
        { "nvle", u8"≤⃒" },
        { "nvlt", u8"<⃒" },
        { "nvltrie", u8"⊴⃒" },
        { "nvrArr", u8"⤃" },
        { "nvrtrie", u8"⊵⃒" },
        { "nvsim", u8"∼⃒" },
        { "nwArr", u8"⇖" },
        { "nwarhk", u8"⤣" },
        { "nwarr", u8"↖" },
        { "nwarrow", u8"↖" },
        { "nwnear", u8"⤧" },
        { "oS", u8"Ⓢ" },
        { "oacute", u8"ó" },
        { "oast", u8"⊛" },
        { "ocir", u8"⊚" },
        { "ocirc", u8"ô" },
        { "ocy", u8"о" },
        { "odash", u8"⊝" },
        { "odblac", u8"ő" },
        { "odiv", u8"⨸" },
        { "odot", u8"⊙" },
        { "odsold", u8"⦼" },
        { "oelig", u8"œ" },
        { "ofcir", u8"⦿" },
        { "ofr", u8"𝔬" },
        { "ogon", u8"˛" },
        { "ograve", u8"ò" },
        { "ogt", u8"⧁" },
        { "ohbar", u8"⦵" },
        { "ohm", u8"Ω" },
        { "oint", u8"∮" },
        { "olarr", u8"↺" },
        { "olcir", u8"⦾" },
        { "olcross", u8"⦻" },
        { "oline", u8"‾" },
        { "olt", u8"⧀" },
        { "omacr", u8"ō" },
        { "omega", u8"ω" },
        { "omicron", u8"ο" },
        { "omid", u8"⦶" },
        { "ominus", u8"⊖" },
        { "oopf", u8"𝕠" },
        { "opar", u8"⦷" },
        { "operp", u8"⦹" },
        { "oplus", u8"⊕" },
        { "or", u8"∨" },
        { "orarr", u8"↻" },
        { "ord", u8"⩝" },
        { "order", u8"ℴ" },
        { "orderof", u8"ℴ" },
        { "ordf", u8"ª" },
        { "ordm", u8"º" },
        { "origof", u8"⊶" },
        { "oror", u8"⩖" },
        { "orslope", u8"⩗" },
        { "orv", u8"⩛" },
        { "oscr", u8"ℴ" },
        { "oslash", u8"ø" },
        { "osol", u8"⊘" },
        { "otilde", u8"õ" },
        { "otimes", u8"⊗" },
        { "otimesas", u8"⨶" },
        { "ouml", u8"ö" },
        { "ovbar", u8"⌽" },
        { "par", u8"∥" },
        { "para", u8"¶" },
        { "parallel", u8"∥" },
        { "parsim", u8"⫳" },
        { "parsl", u8"⫽" },
        { "part", u8"∂" },
        { "pcy", u8"п" },
        { "percnt", u8"%" },
        { "period", u8"." },
        { "permil", u8"‰" },
        { "perp", u8"⊥" },
        { "pertenk", u8"‱" },
        { "pfr", u8"𝔭" },
        { "phi", u8"φ" },
        { "phiv", u8"ϕ" },
        { "phmmat", u8"ℳ" },
        { "phone", u8"☎" },
        { "pi", u8"π" },
        { "pitchfork", u8"⋔" },
        { "piv", u8"ϖ" },
        { "planck", u8"ℏ" },
        { "planckh", u8"ℎ" },
        { "plankv", u8"ℏ" },
        { "plus", u8"+" },
        { "plusacir", u8"⨣" },
        { "plusb", u8"⊞" },
        { "pluscir", u8"⨢" },
        { "plusdo", u8"∔" },
        { "plusdu", u8"⨥" },
        { "pluse", u8"⩲" },
        { "plusmn", u8"±" },
        { "plussim", u8"⨦" },
        { "plustwo", u8"⨧" },
        { "pm", u8"±" },
        { "pointint", u8"⨕" },
        { "popf", u8"𝕡" },
        { "pound", u8"£" },
        { "pr", u8"≺" },
        { "prE", u8"⪳" },
        { "prap", u8"⪷" },
        { "prcue", u8"≼" },
        { "pre", u8"⪯" },
        { "prec", u8"≺" },
        { "precapprox", u8"⪷" },
        { "preccurlyeq", u8"≼" },
        { "preceq", u8"⪯" },
        { "precnapprox", u8"⪹" },
        { "precneqq", u8"⪵" },
        { "precnsim", u8"⋨" },
        { "precsim", u8"≾" },
        { "prime", u8"′" },
        { "primes", u8"ℙ" },
        { "prnE", u8"⪵" },
        { "prnap", u8"⪹" },
        { "prnsim", u8"⋨" },
        { "prod", u8"∏" },
        { "profalar", u8"⌮" },
        { "profline", u8"⌒" },
        { "profsurf", u8"⌓" },
        { "prop", u8"∝" },
        { "propto", u8"∝" },
        { "prsim", u8"≾" },
        { "prurel", u8"⊰" },
        { "pscr", u8"𝓅" },
        { "psi", u8"ψ" },
        { "puncsp", u8" " },
        { "qfr", u8"𝔮" },
        { "qint", u8"⨌" },
        { "qopf", u8"𝕢" },
        { "qprime", u8"⁗" },
        { "qscr", u8"𝓆" },
        { "quaternions", u8"ℍ" },
        { "quatint", u8"⨖" },
        { "quest", u8"?" },
        { "questeq", u8"≟" },
        { "quot", u8"\"" },
        { "rAarr", u8"⇛" },
        { "rArr", u8"⇒" },
        { "rAtail", u8"⤜" },
        { "rBarr", u8"⤏" },
        { "rHar", u8"⥤" },
        { "race", u8"∽̱" },
        { "racute", u8"ŕ" },
        { "radic", u8"√" },
        { "raemptyv", u8"⦳" },
        { "rang", u8"⟩" },
        { "rangd", u8"⦒" },
        { "range", u8"⦥" },
        { "rangle", u8"⟩" },
        { "raquo", u8"»" },
        { "rarr", u8"→" },
        { "rarrap", u8"⥵" },
        { "rarrb", u8"⇥" },
        { "rarrbfs", u8"⤠" },
        { "rarrc", u8"⤳" },
        { "rarrfs", u8"⤞" },
        { "rarrhk", u8"↪" },
        { "rarrlp", u8"↬" },
        { "rarrpl", u8"⥅" },
        { "rarrsim", u8"⥴" },
        { "rarrtl", u8"↣" },
        { "rarrw", u8"↝" },
        { "ratail", u8"⤚" },
        { "ratio", u8"∶" },
        { "rationals", u8"ℚ" },
        { "rbarr", u8"⤍" },
        { "rbbrk", u8"❳" },
        { "rbrace", u8"}" },
        { "rbrack", u8"]" },
        { "rbrke", u8"⦌" },
        { "rbrksld", u8"⦎" },
        { "rbrkslu", u8"⦐" },
        { "rcaron", u8"ř" },
        { "rcedil", u8"ŗ" },
        { "rceil", u8"⌉" },
        { "rcub", u8"}" },
        { "rcy", u8"р" },
        { "rdca", u8"⤷" },
        { "rdldhar", u8"⥩" },
        { "rdquo", u8"”" },
        { "rdquor", u8"”" },
        { "rdsh", u8"↳" },
        { "real", u8"ℜ" },
        { "realine", u8"ℛ" },
        { "realpart", u8"ℜ" },
        { "reals", u8"ℝ" },
        { "rect", u8"▭" },
        { "reg", u8"®" },
        { "rfisht", u8"⥽" },
        { "rfloor", u8"⌋" },
        { "rfr", u8"𝔯" },
        { "rhard", u8"⇁" },
        { "rharu", u8"⇀" },
        { "rharul", u8"⥬" },
        { "rho", u8"ρ" },
        { "rhov", u8"ϱ" },
        { "rightarrow", u8"→" },
        { "rightarrowtail", u8"↣" },
        { "rightharpoondown", u8"⇁" },
        { "rightharpoonup", u8"⇀" },
        { "rightleftarrows", u8"⇄" },
        { "rightleftharpoons", u8"⇌" },
        { "rightrightarrows", u8"⇉" },
        { "rightsquigarrow", u8"↝" },
        { "rightthreetimes", u8"⋌" },
        { "ring", u8"˚" },
        { "risingdotseq", u8"≓" },
        { "rlarr", u8"⇄" },
        { "rlhar", u8"⇌" },
        { "rlm", u8"‏" },
        { "rmoust", u8"⎱" },
        { "rmoustache", u8"⎱" },
        { "rnmid", u8"⫮" },
        { "roang", u8"⟭" },
        { "roarr", u8"⇾" },
        { "robrk", u8"⟧" },
        { "ropar", u8"⦆" },
        { "ropf", u8"𝕣" },
        { "roplus", u8"⨮" },
        { "rotimes", u8"⨵" },
        { "rpar", u8")" },
        { "rpargt", u8"⦔" },
        { "rppolint", u8"⨒" },
        { "rrarr", u8"⇉" },
        { "rsaquo", u8"›" },
        { "rscr", u8"𝓇" },
        { "rsh", u8"↱" },
        { "rsqb", u8"]" },
        { "rsquo", u8"’" },
        { "rsquor", u8"’" },
        { "rthree", u8"⋌" },
        { "rtimes", u8"⋊" },
        { "rtri", u8"▹" },
        { "rtrie", u8"⊵" },
        { "rtrif", u8"▸" },
        { "rtriltri", u8"⧎" },
        { "ruluhar", u8"⥨" },
        { "rx", u8"℞" },
        { "sacute", u8"ś" },
        { "sbquo", u8"‚" },
        { "sc", u8"≻" },
        { "scE", u8"⪴" },
        { "scap", u8"⪸" },
        { "scaron", u8"š" },
        { "sccue", u8"≽" },
        { "sce", u8"⪰" },
        { "scedil", u8"ş" },
        { "scirc", u8"ŝ" },
        { "scnE", u8"⪶" },
        { "scnap", u8"⪺" },
        { "scnsim", u8"⋩" },
        { "scpolint", u8"⨓" },
        { "scsim", u8"≿" },
        { "scy", u8"с" },
        { "sdot", u8"⋅" },
        { "sdotb", u8"⊡" },
        { "sdote", u8"⩦" },
        { "seArr", u8"⇘" },
        { "searhk", u8"⤥" },
        { "searr", u8"↘" },
        { "searrow", u8"↘" },
        { "sect", u8"§" },
        { "semi", u8";" },
        { "seswar", u8"⤩" },
        { "setminus", u8"∖" },
        { "setmn", u8"∖" },
        { "sext", u8"✶" },
        { "sfr", u8"𝔰" },
        { "sfrown", u8"⌢" },
        { "sharp", u8"♯" },
        { "shchcy", u8"щ" },
        { "shcy", u8"ш" },
        { "shortmid", u8"∣" },
        { "shortparallel", u8"∥" },
        { "shy", u8"­" },
        { "sigma", u8"σ" },
        { "sigmaf", u8"ς" },
        { "sigmav", u8"ς" },
        { "sim", u8"∼" },
        { "simdot", u8"⩪" },
        { "sime", u8"≃" },
        { "simeq", u8"≃" },
        { "simg", u8"⪞" },
        { "simgE", u8"⪠" },
        { "siml", u8"⪝" },
        { "simlE", u8"⪟" },
        { "simne", u8"≆" },
        { "simplus", u8"⨤" },
        { "simrarr", u8"⥲" },
        { "slarr", u8"←" },
        { "smallsetminus", u8"∖" },
        { "smashp", u8"⨳" },
        { "smeparsl", u8"⧤" },
        { "smid", u8"∣" },
        { "smile", u8"⌣" },
        { "smt", u8"⪪" },
        { "smte", u8"⪬" },
        { "smtes", u8"⪬︀" },
        { "softcy", u8"ь" },
        { "sol", u8"/" },
        { "solb", u8"⧄" },
        { "solbar", u8"⌿" },
        { "sopf", u8"𝕤" },
        { "spades", u8"♠" },
        { "spadesuit", u8"♠" },
        { "spar", u8"∥" },
        { "sqcap", u8"⊓" },
        { "sqcaps", u8"⊓︀" },
        { "sqcup", u8"⊔" },
        { "sqcups", u8"⊔︀" },
        { "sqsub", u8"⊏" },
        { "sqsube", u8"⊑" },
        { "sqsubset", u8"⊏" },
        { "sqsubseteq", u8"⊑" },
        { "sqsup", u8"⊐" },
        { "sqsupe", u8"⊒" },
        { "sqsupset", u8"⊐" },
        { "sqsupseteq", u8"⊒" },
        { "squ", u8"□" },
        { "square", u8"□" },
        { "squarf", u8"▪" },
        { "squf", u8"▪" },
        { "srarr", u8"→" },
        { "sscr", u8"𝓈" },
        { "ssetmn", u8"∖" },
        { "ssmile", u8"⌣" },
        { "sstarf", u8"⋆" },
        { "star", u8"☆" },
        { "starf", u8"★" },
        { "straightepsilon", u8"ϵ" },
        { "straightphi", u8"ϕ" },
        { "strns", u8"¯" },
        { "sub", u8"⊂" },
        { "subE", u8"⫅" },
        { "subdot", u8"⪽" },
        { "sube", u8"⊆" },
        { "subedot", u8"⫃" },
        { "submult", u8"⫁" },
        { "subnE", u8"⫋" },
        { "subne", u8"⊊" },
        { "subplus", u8"⪿" },
        { "subrarr", u8"⥹" },
        { "subset", u8"⊂" },
        { "subseteq", u8"⊆" },
        { "subseteqq", u8"⫅" },
        { "subsetneq", u8"⊊" },
        { "subsetneqq", u8"⫋" },
        { "subsim", u8"⫇" },
        { "subsub", u8"⫕" },
        { "subsup", u8"⫓" },
        { "succ", u8"≻" },
        { "succapprox", u8"⪸" },
        { "succcurlyeq", u8"≽" },
        { "succeq", u8"⪰" },
        { "succnapprox", u8"⪺" },
        { "succneqq", u8"⪶" },
        { "succnsim", u8"⋩" },
        { "succsim", u8"≿" },
        { "sum", u8"∑" },
        { "sung", u8"♪" },
        { "sup1", u8"¹" },
        { "sup2", u8"²" },
        { "sup3", u8"³" },
        { "sup", u8"⊃" },
        { "supE", u8"⫆" },
        { "supdot", u8"⪾" },
        { "supdsub", u8"⫘" },
        { "supe", u8"⊇" },
        { "supedot", u8"⫄" },
        { "suphsol", u8"⟉" },
        { "suphsub", u8"⫗" },
        { "suplarr", u8"⥻" },
        { "supmult", u8"⫂" },
        { "supnE", u8"⫌" },
        { "supne", u8"⊋" },
        { "supplus", u8"⫀" },
        { "supset", u8"⊃" },
        { "supseteq", u8"⊇" },
        { "supseteqq", u8"⫆" },
        { "supsetneq", u8"⊋" },
        { "supsetneqq", u8"⫌" },
        { "supsim", u8"⫈" },
        { "supsub", u8"⫔" },
        { "supsup", u8"⫖" },
        { "swArr", u8"⇙" },
        { "swarhk", u8"⤦" },
        { "swarr", u8"↙" },
        { "swarrow", u8"↙" },
        { "swnwar", u8"⤪" },
        { "szlig", u8"ß" },
        { "target", u8"⌖" },
        { "tau", u8"τ" },
        { "tbrk", u8"⎴" },
        { "tcaron", u8"ť" },
        { "tcedil", u8"ţ" },
        { "tcy", u8"т" },
        { "tdot", u8"⃛" },
        { "telrec", u8"⌕" },
        { "tfr", u8"𝔱" },
        { "there4", u8"∴" },
        { "therefore", u8"∴" },
        { "theta", u8"θ" },
        { "thetasym", u8"ϑ" },
        { "thetav", u8"ϑ" },
        { "thickapprox", u8"≈" },
        { "thicksim", u8"∼" },
        { "thinsp", u8" " },
        { "thkap", u8"≈" },
        { "thksim", u8"∼" },
        { "thorn", u8"þ" },
        { "tilde", u8"˜" },
        { "times", u8"×" },
        { "timesb", u8"⊠" },
        { "timesbar", u8"⨱" },
        { "timesd", u8"⨰" },
        { "tint", u8"∭" },
        { "toea", u8"⤨" },
        { "top", u8"⊤" },
        { "topbot", u8"⌶" },
        { "topcir", u8"⫱" },
        { "topf", u8"𝕥" },
        { "topfork", u8"⫚" },
        { "tosa", u8"⤩" },
        { "tprime", u8"‴" },
        { "trade", u8"™" },
        { "triangle", u8"▵" },
        { "triangledown", u8"▿" },
        { "triangleleft", u8"◃" },
        { "trianglelefteq", u8"⊴" },
        { "triangleq", u8"≜" },
        { "triangleright", u8"▹" },
        { "trianglerighteq", u8"⊵" },
        { "tridot", u8"◬" },
        { "trie", u8"≜" },
        { "triminus", u8"⨺" },
        { "triplus", u8"⨹" },
        { "trisb", u8"⧍" },
        { "tritime", u8"⨻" },
        { "trpezium", u8"⏢" },
        { "tscr", u8"𝓉" },
        { "tscy", u8"ц" },
        { "tshcy", u8"ћ" },
        { "tstrok", u8"ŧ" },
        { "twixt", u8"≬" },
        { "twoheadleftarrow", u8"↞" },
        { "twoheadrightarrow", u8"↠" },
        { "uArr", u8"⇑" },
        { "uHar", u8"⥣" },
        { "uacute", u8"ú" },
        { "uarr", u8"↑" },
        { "ubrcy", u8"ў" },
        { "ubreve", u8"ŭ" },
        { "ucirc", u8"û" },
        { "ucy", u8"у" },
        { "udarr", u8"⇅" },
        { "udblac", u8"ű" },
        { "udhar", u8"⥮" },
        { "ufisht", u8"⥾" },
        { "ufr", u8"𝔲" },
        { "ugrave", u8"ù" },
        { "uharl", u8"↿" },
        { "uharr", u8"↾" },
        { "uhblk", u8"▀" },
        { "ulcorn", u8"⌜" },
        { "ulcorner", u8"⌜" },
        { "ulcrop", u8"⌏" },
        { "ultri", u8"◸" },
        { "umacr", u8"ū" },
        { "uml", u8"¨" },
        { "uogon", u8"ų" },
        { "uopf", u8"𝕦" },
        { "uparrow", u8"↑" },
        { "updownarrow", u8"↕" },
        { "upharpoonleft", u8"↿" },
        { "upharpoonright", u8"↾" },
        { "uplus", u8"⊎" },
        { "upsi", u8"υ" },
        { "upsih", u8"ϒ" },
        { "upsilon", u8"υ" },
        { "upuparrows", u8"⇈" },
        { "urcorn", u8"⌝" },
        { "urcorner", u8"⌝" },
        { "urcrop", u8"⌎" },
        { "uring", u8"ů" },
        { "urtri", u8"◹" },
        { "uscr", u8"𝓊" },
        { "utdot", u8"⋰" },
        { "utilde", u8"ũ" },
        { "utri", u8"▵" },
        { "utrif", u8"▴" },
        { "uuarr", u8"⇈" },
        { "uuml", u8"ü" },
        { "uwangle", u8"⦧" },
        { "vArr", u8"⇕" },
        { "vBar", u8"⫨" },
        { "vBarv", u8"⫩" },
        { "vDash", u8"⊨" },
        { "vangrt", u8"⦜" },
        { "varepsilon", u8"ϵ" },
        { "varkappa", u8"ϰ" },
        { "varnothing", u8"∅" },
        { "varphi", u8"ϕ" },
        { "varpi", u8"ϖ" },
        { "varpropto", u8"∝" },
        { "varr", u8"↕" },
        { "varrho", u8"ϱ" },
        { "varsigma", u8"ς" },
        { "varsubsetneq", u8"⊊︀" },
        { "varsubsetneqq", u8"⫋︀" },
        { "varsupsetneq", u8"⊋︀" },
        { "varsupsetneqq", u8"⫌︀" },
        { "vartheta", u8"ϑ" },
        { "vartriangleleft", u8"⊲" },
        { "vartriangleright", u8"⊳" },
        { "vcy", u8"в" },
        { "vdash", u8"⊢" },
        { "vee", u8"∨" },
        { "veebar", u8"⊻" },
        { "veeeq", u8"≚" },
        { "vellip", u8"⋮" },
        { "verbar", u8"|" },
        { "vert", u8"|" },
        { "vfr", u8"𝔳" },
        { "vltri", u8"⊲" },
        { "vnsub", u8"⊂⃒" },
        { "vnsup", u8"⊃⃒" },
        { "vopf", u8"𝕧" },
        { "vprop", u8"∝" },
        { "vrtri", u8"⊳" },
        { "vscr", u8"𝓋" },
        { "vsubnE", u8"⫋︀" },
        { "vsubne", u8"⊊︀" },
        { "vsupnE", u8"⫌︀" },
        { "vsupne", u8"⊋︀" },
        { "vzigzag", u8"⦚" },
        { "wcirc", u8"ŵ" },
        { "wedbar", u8"⩟" },
        { "wedge", u8"∧" },
        { "wedgeq", u8"≙" },
        { "weierp", u8"℘" },
        { "wfr", u8"𝔴" },
        { "wopf", u8"𝕨" },
        { "wp", u8"℘" },
        { "wr", u8"≀" },
        { "wreath", u8"≀" },
        { "wscr", u8"𝓌" },
        { "xcap", u8"⋂" },
        { "xcirc", u8"◯" },
        { "xcup", u8"⋃" },
        { "xdtri", u8"▽" },
        { "xfr", u8"𝔵" },
        { "xhArr", u8"⟺" },
        { "xharr", u8"⟷" },
        { "xi", u8"ξ" },
        { "xlArr", u8"⟸" },
        { "xlarr", u8"⟵" },
        { "xmap", u8"⟼" },
        { "xnis", u8"⋻" },
        { "xodot", u8"⨀" },
        { "xopf", u8"𝕩" },
        { "xoplus", u8"⨁" },
        { "xotime", u8"⨂" },
        { "xrArr", u8"⟹" },
        { "xrarr", u8"⟶" },
        { "xscr", u8"𝓍" },
        { "xsqcup", u8"⨆" },
        { "xuplus", u8"⨄" },
        { "xutri", u8"△" },
        { "xvee", u8"⋁" },
        { "xwedge", u8"⋀" },
        { "yacute", u8"ý" },
        { "yacy", u8"я" },
        { "ycirc", u8"ŷ" },
        { "ycy", u8"ы" },
        { "yen", u8"¥" },
        { "yfr", u8"𝔶" },
        { "yicy", u8"ї" },
        { "yopf", u8"𝕪" },
        { "yscr", u8"𝓎" },
        { "yucy", u8"ю" },
        { "yuml", u8"ÿ" },
        { "zacute", u8"ź" },
        { "zcaron", u8"ž" },
        { "zcy", u8"з" },
        { "zdot", u8"ż" },
        { "zeetrf", u8"ℨ" },
        { "zeta", u8"ζ" },
        { "zfr", u8"𝔷" },
        { "zhcy", u8"ж" },
        { "zigrarr", u8"⇝" },
        { "zopf", u8"𝕫" },
        { "zscr", u8"𝓏" },
        { "zwj", u8"‍" },
        { "zwnj", u8"‌" },
    };
    return table;
}

/// Resolve one reference body (name, or "#digits") to its character, or leave
/// the reference unresolved when it is unrecognized / unsafe.
///
/// The numeric accumulator saturates just above U+10FFFF instead of running
/// dry on absurd digit runs — one guard covering both the out-of-range check
/// and the overflow check that u32::from_str_radix performs in the Rust port.
/// Lone surrogates (U+D800..U+DFFF) get their own explicit check.
inline void resolve_body(std::string_view body, reference& ref) {
    if (body[0] == '#') {
        const bool hex = body.size() >= 2 && (body[1] == 'x' || body[1] == 'X');
        const std::string_view digits = hex ? body.substr(2) : body.substr(1);

        bool overflow = false;
        std::uint64_t acc = 0;
        for (char d : digits) {
            if (!overflow) {
                acc = acc * (hex ? 16u : 10u) + digit_value(d);
                if (acc > 0x10FFFF) {
                    overflow = true; // saturate; keep scanning digits
                }
            }
        }

        if (overflow || acc > 0x10FFFF || (acc >= 0xD800 && acc <= 0xDFFF)) {
            ref.resolved = false; // out of range or a lone surrogate
            return;
        }
        ref.value.clear();
        append_utf8(ref.value, static_cast<std::uint32_t>(acc));
        ref.resolved = true;
        return;
    }

    // Named reference: one hash lookup over the full WHATWG table.
    const auto& table = entity_table();
    auto it = table.find(std::string(body));
    if (it != table.end()) {
        ref.value = it->second;
        ref.resolved = true;
    } else {
        ref.resolved = false; // unknown name — keep the original text whole
    }
}

/// Hand-rolled matcher for the grammar
///   &(#[xX][0-9a-fA-F]+|#[0-9]+|[A-Za-z][A-Za-z0-9]*);
/// Given that text[start] == '&', attempt to parse a well-formed reference.
/// Returns true and fills ref on success (which includes "resolved = false"
/// for unknown / unsafe references — the caller then keeps the original text
/// whole). Returns false when no reference grammar matches at all.
inline bool parse_reference(std::string_view text, std::size_t start,
                            reference& ref) {
    const std::size_t n = text.size();
    std::size_t j = start + 1; // just past '&'
    if (j >= n) {
        return false;
    }

    // Identify the body grammar and scan its trailing index into j.
    if (text[j] == '#') {
        ++j;
        if (j >= n) {
            return false;
        }
        bool hex = text[j] == 'x' || text[j] == 'X';
        if (hex) {
            ++j;
        }
        std::size_t digits_start = j;
        while (j < n && entity_digit(text[j], hex)) {
            ++j;
        }
        if (j == digits_start) {
            return false; // '#' / '#x' with no digits is not a reference
        }
    } else if (ascii_letter(text[j])) {
        ++j;
        while (j < n && ascii_alnum(text[j])) {
            ++j;
        }
    } else {
        return false; // '&' not followed by '#' or a letter
    }

    // The body must be terminated by ';'.
    if (j >= n || text[j] != ';') {
        return false;
    }

    ref.end = j + 1;
    resolve_body(text.substr(start + 1, j - start - 1), ref);
    return true;
}

} // namespace detail

/// Escape the five HTML-significant characters.
///
/// A single-pass loop over code points: '&' is emitted as "&amp;" and so on.
/// (The Python port runs five sequential replaces and must replace '&' first
/// so its own output is never re-escaped — matching on one code point at a
/// time makes that ordering concern moot.)
///
/// With `ascii` set, every non-ASCII code point is additionally rewritten to
/// a decimal numeric reference. The loop decodes UTF-8 to full scalar values,
/// so an astral character such as an emoji encodes as a single reference
/// rather than two surrogate halves.
inline std::string encode_html(std::string_view text,
                               const encode_options& opts = {}) {
    std::string out;
    out.reserve(text.size() + 16);

    const auto* p = reinterpret_cast<const unsigned char*>(text.data());
    std::size_t n = text.size();
    std::size_t i = 0;
    while (i < n) {
        std::uint32_t cp = 0;
        std::size_t w = detail::utf8_next(p + i, n - i, &cp);
        if (w == 0) {
            w = 1; // invalid lead byte: copy it through, stay total
        }

        switch (cp) {
        case '&':
            out += "&amp;";
            break;
        case '<':
            out += "&lt;";
            break;
        case '>':
            out += "&gt;";
            break;
        case '\'':
            out += "&apos;";
            break;
        case '"':
            out += "&quot;";
            break;
        default:
            if (opts.ascii && cp > 0x7F) {
                out += "&#";
                out += std::to_string(cp);
                out += ';';
            } else {
                out.append(text.substr(i, w));
            }
            break;
        }
        i += w;
    }
    return out;
}

/// Decode every recognized reference in `text`. Unknown references and stray
/// ampersands are left exactly as they appear in the input. Decode is total:
/// it never throws on malformed or out-of-range input — such references are
/// returned verbatim.
inline std::string decode_html(std::string_view text) {
    std::string out;
    out.reserve(text.size());

    const std::size_t n = text.size();
    std::size_t i = 0;
    while (i < n) {
        detail::reference ref;
        if (text[i] == '&' && detail::parse_reference(text, i, ref)) {
            if (ref.resolved) {
                out.append(ref.value);
            } else {
                out.append(text.substr(i, ref.end - i));
            }
            i = ref.end;
            continue;
        }
        // No reference starts here: copy one byte and advance. '&' can never
        // appear inside a multi-byte UTF-8 sequence, so byte-wise copying
        // never splits a character.
        out.push_back(text[i]);
        ++i;
    }
    return out;
}

} // namespace cosmodev

Also available in 13 other languages

Every CosmoDev tool ships its pure logic in TypeScript (web) and Go (CLI), with authored implementations in a dozen-plus languages — the same contract, ported. Compare all languages side by side →