Files
2025-etpgrf/tests/test_codec.py

394 lines
42 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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