Skip to content

Instantly share code, notes, and snippets.

@FranciscoG
Last active May 4, 2022 09:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FranciscoG/0c19eb81869fd2af0100eb7af8b527ab to your computer and use it in GitHub Desktop.
Save FranciscoG/0c19eb81869fd2af0100eb7af8b527ab to your computer and use it in GitHub Desktop.
a collection of mini functions that return special characters from their character codes in Javascript
/* Special Characters */
// <
// less-than sign
export const lt = () => String.fromCharCode(60);
// >
// greater-than sign
export const gt = () => String.fromCharCode(62);
// "
// quotation mark
export const quot = () => String.fromCharCode(34);
// &
// ampersand
export const amp = () => String.fromCharCode(38);
/* Latin-1 entity set for HTML */
// no-break space
export const nbsp = () => String.fromCharCode(160);
// ¡
// inverted exclamation mark
export const iexcl = () => String.fromCharCode(161);
// ¢
// cent sign
export const cent = () => String.fromCharCode(162);
// £
// pound sterling sign
export const pound = () => String.fromCharCode(163);
// ¤
// general currency sign
export const curren = () => String.fromCharCode(164);
// ¥
// yen sign
export const yen = () => String.fromCharCode(165);
// ¦
// broken (vertical) bar
export const brvbar = () => String.fromCharCode(166);
// §
// section sign
export const sect = () => String.fromCharCode(167);
// ¨
// umlaut (dieresis);
export const uml = () => String.fromCharCode(168);
// ©
// copyright sign
export const copy = () => String.fromCharCode(169);
// ª
// ordinal indicator, feminine
export const ordf = () => String.fromCharCode(170);
// «
// angle quotation mark, left
export const laquo = () => String.fromCharCode(171);
// ¬
// not sign
export const not = () => String.fromCharCode(172);
//
// soft hyphen
export const shy = () => String.fromCharCode(173);
// ®
// registered sign
export const reg = () => String.fromCharCode(174);
// ¯
// macron
export const macr = () => String.fromCharCode(175);
// °
// degree sign
export const deg = () => String.fromCharCode(176);
// ±
// plus-or-minus sign
export const plusmn = () => String.fromCharCode(177);
// ²
// superscript two
export const sup2 = () => String.fromCharCode(178);
// ³
// superscript three
export const sup3 = () => String.fromCharCode(179);
// ´
// acute accent
export const acute = () => String.fromCharCode(180);
// µ
// micro sign
export const micro = () => String.fromCharCode(181);
// ¶
// pilcrow (paragraph sign);
export const para = () => String.fromCharCode(182);
// ·
// middle dot
export const middot = () => String.fromCharCode(183);
// ¸
// cedilla
export const cedil = () => String.fromCharCode(184);
// ¹
// superscript one
export const sup1 = () => String.fromCharCode(185);
// º
// ordinal indicator, masculine
export const ordm = () => String.fromCharCode(186);
// »
// angle quotation mark, right
export const raquo = () => String.fromCharCode(187);
// ¼
// fraction one-quarter
export const frac14 = () => String.fromCharCode(188);
// ½
// fraction one-half
export const frac12 = () => String.fromCharCode(189);
// ¾
// fraction three-quarters
export const frac34 = () => String.fromCharCode(190);
// ¿
// inverted question mark
export const iquest = () => String.fromCharCode(191);
// À
// capital A, grave accent
export const Agrave = () => String.fromCharCode(192);
// Á
// capital A, acute accent
export const Aacute = () => String.fromCharCode(193);
// Â
// capital A, circumflex accent
export const Acirc = () => String.fromCharCode(194);
// Ã
// capital A, tilde
export const Atilde = () => String.fromCharCode(195);
// Ä
// capital A, dieresis or umlaut mark
export const Auml = () => String.fromCharCode(196);
// Å
// capital A, ring
export const Aring = () => String.fromCharCode(197);
// Æ
// capital AE diphthong (ligature);
export const AElig = () => String.fromCharCode(198);
// Ç
// capital C, cedilla
export const Ccedil = () => String.fromCharCode(199);
// È
// capital E, grave accent
export const Egrave = () => String.fromCharCode(200);
// É
// capital E, acute accent
export const Eacute = () => String.fromCharCode(201);
// Ê
// capital E, circumflex accent
export const Ecirc = () => String.fromCharCode(202);
// Ë
// capital E, dieresis or umlaut mark
export const Euml = () => String.fromCharCode(203);
// Ì
// capital I, grave accent
export const Igrave = () => String.fromCharCode(204);
// Í
// capital I, acute accent
export const Iacute = () => String.fromCharCode(205);
// Î
// capital I, circumflex accent
export const Icirc = () => String.fromCharCode(206);
// Ï
// capital I, dieresis or umlaut mark
export const Iuml = () => String.fromCharCode(207);
// Ð
// capital Eth, Icelandic
export const ETH = () => String.fromCharCode(208);
// Ñ
// capital N, tilde
export const Ntilde = () => String.fromCharCode(209);
// Ò
// capital O, grave accent
export const Ograve = () => String.fromCharCode(210);
// Ó
// capital O, acute accent
export const Oacute = () => String.fromCharCode(211);
// Ô
// capital O, circumflex accent
export const Ocirc = () => String.fromCharCode(212);
// Õ
// capital O, tilde
export const Otilde = () => String.fromCharCode(213);
// Ö
// capital O, dieresis or umlaut mark
export const Ouml = () => String.fromCharCode(214);
// ×
// multiply sign
export const times = () => String.fromCharCode(215);
// Ø
// capital O, slash
export const Oslash = () => String.fromCharCode(216);
// Ù
// capital U, grave accent
export const Ugrave = () => String.fromCharCode(217);
// Ú
// capital U, acute accent
export const Uacute = () => String.fromCharCode(218);
// Û
// capital U, circumflex accent
export const Ucirc = () => String.fromCharCode(219);
// Ü
// capital U, dieresis or umlaut mark
export const Uuml = () => String.fromCharCode(220);
// Ý
// capital Y, acute accent
export const Yacute = () => String.fromCharCode(221);
// Þ
// capital THORN, Icelandic
export const THORN = () => String.fromCharCode(222);
// ß
// small sharp s, German (sz ligature);
export const szlig = () => String.fromCharCode(223);
// à
// small a, grave accent
export const agrave = () => String.fromCharCode(224);
// á
// small a, acute accent
export const aacute = () => String.fromCharCode(225);
// â
// small a, circumflex accent
export const acirc = () => String.fromCharCode(226);
// ã
// small a, tilde
export const atilde = () => String.fromCharCode(227);
// ä
// small a, dieresis or umlaut mark
export const auml = () => String.fromCharCode(228);
// å
// small a, ring
export const aring = () => String.fromCharCode(229);
// æ
// small ae diphthong (ligature);
export const aelig = () => String.fromCharCode(230);
// ç
// small c, cedilla
export const ccedil = () => String.fromCharCode(231);
// è
// small e, grave accent
export const egrave = () => String.fromCharCode(232);
// é
// small e, acute accent
export const eacute = () => String.fromCharCode(233);
// ê
// small e, circumflex accent
export const ecirc = () => String.fromCharCode(234);
// ë
// small e, dieresis or umlaut mark
export const euml = () => String.fromCharCode(235);
// ì
// small i, grave accent
export const igrave = () => String.fromCharCode(236);
// í
// small i, acute accent
export const iacute = () => String.fromCharCode(237);
// î
// small i, circumflex accent
export const icirc = () => String.fromCharCode(238);
// ï
// small i, dieresis or umlaut mark
export const iuml = () => String.fromCharCode(239);
// ð
// small eth, Icelandic
export const eth = () => String.fromCharCode(240);
// ñ
// small n, tilde
export const ntilde = () => String.fromCharCode(241);
// ò
// small o, grave accent
export const ograve = () => String.fromCharCode(242);
// ó
// small o, acute accent
export const oacute = () => String.fromCharCode(243);
// ô
// small o, circumflex accent
export const ocirc = () => String.fromCharCode(244);
// õ
// small o, tilde
export const otilde = () => String.fromCharCode(245);
// ö
// small o, dieresis or umlaut mark
export const ouml = () => String.fromCharCode(246);
// ÷
// divide sign
export const divide = () => String.fromCharCode(247);
// ø
// small o, slash
export const oslash = () => String.fromCharCode(248);
// ù
// small u, grave accent
export const ugrave = () => String.fromCharCode(249);
// ú
// small u, acute accent
export const uacute = () => String.fromCharCode(250);
// û
// small u, circumflex accent
export const ucirc = () => String.fromCharCode(251);
// ü
// small u, dieresis or umlaut mark
export const uuml = () => String.fromCharCode(252);
// ý
// small y, acute accent
export const yacute = () => String.fromCharCode(253);
// þ
// small thorn, Icelandic
export const thorn = () => String.fromCharCode(254);
// ÿ
// small y, dieresis or umlaut mark
export const yuml = () => String.fromCharCode(255);
/* Latin Extended-A */
// Œ
// latin capital ligature oe
export const OElig = () => String.fromCharCode(338);
// œ
// latin small ligature oe, (ligature is a misnomer, this is a separate character in some languages);
export const oelig = () => String.fromCharCode(339);
// Š
// latin capital letter s with caron
export const Scaron = () => String.fromCharCode(352);
// š
// latin small letter s with caron
export const scaron = () => String.fromCharCode(353);
// Ÿ
// latin capital letter y with diaeresis
export const Yuml = () => String.fromCharCode(376);
/* #Latin Extended-B */
// ƒ
// latin small f with hook, a.k.a. function, a.k.a. florin
export const fnof = () => String.fromCharCode(402);
/* Spacing Modifier Letters */
// ˆ
// modifier letter circumflex accent
// export const circ = () => String.fromCharCode(??????);
// ˜
// small tilde
// export const tilde = () => String.fromCharCode(??????);
/* Greek */
// Α
// greek capital letter alpha
export const Alpha = () => String.fromCharCode(913);
// Β
// greek capital letter beta
export const Beta = () => String.fromCharCode(914);
// Γ
// greek capital letter gamma
export const Gamma = () => String.fromCharCode(915);
// Δ
// greek capital letter delta
export const Delta = () => String.fromCharCode(916);
// Ε
// greek capital letter epsilon
export const Epsilon = () => String.fromCharCode(917);
// Ζ
// greek capital letter zeta
export const Zeta = () => String.fromCharCode(918);
// Η
// greek capital letter eta
export const Eta = () => String.fromCharCode(919);
// Θ
// greek capital letter theta
export const Theta = () => String.fromCharCode(920);
// Ι
// greek capital letter iota
export const Iota = () => String.fromCharCode(921);
// Κ
// greek capital letter kappa
export const Kappa = () => String.fromCharCode(922);
// Λ
// greek capital letter lambda
export const Lambda = () => String.fromCharCode(923);
// Μ
// greek capital letter mu
export const Mu = () => String.fromCharCode(924);
// Ν
// greek capital letter nu
export const Nu = () => String.fromCharCode(925);
// Ξ
// greek capital letter xi
export const Xi = () => String.fromCharCode(926);
// Ο
// greek capital letter omicron
export const Omicron = () => String.fromCharCode(927);
// Π
// greek capital letter pi
export const Pi = () => String.fromCharCode(928);
// Ρ
// greek capital letter rho
export const Rho = () => String.fromCharCode(929);
// Σ
// greek capital letter sigma
export const Sigma = () => String.fromCharCode(931);
// Τ
// greek capital letter tau
export const Tau = () => String.fromCharCode(932);
// Υ
// greek capital letter upsilon
export const Upsilon = () => String.fromCharCode(933);
// Φ
// greek capital letter phi
export const Phi = () => String.fromCharCode(934);
// Χ
// greek capital letter chi
export const Chi = () => String.fromCharCode(935);
// Ψ
// greek capital letter psi
export const Psi = () => String.fromCharCode(936);
// Ω
// greek capital letter omega
export const Omega = () => String.fromCharCode(937);
// α
// greek small letter alpha
export const alpha = () => String.fromCharCode(945);
// β
// greek small letter beta
export const beta = () => String.fromCharCode(946);
// γ
// greek small letter gamma
export const gamma = () => String.fromCharCode(947);
// δ
// greek small letter delta
export const delta = () => String.fromCharCode(948);
// ε
// greek small letter epsilon
export const epsilon = () => String.fromCharCode(949);
// ζ
// greek small letter zeta
export const zeta = () => String.fromCharCode(950);
// η
// greek small letter eta
export const eta = () => String.fromCharCode(951);
// θ
// greek small letter theta
export const theta = () => String.fromCharCode(952);
// ι
// greek small letter iota
export const iota = () => String.fromCharCode(953);
// κ
// greek small letter kappa
export const kappa = () => String.fromCharCode(954);
// λ
// greek small letter lambda
export const lambda = () => String.fromCharCode(955);
// μ
// greek small letter mu
export const mu = () => String.fromCharCode(956);
// ν
// greek small letter nu
export const nu = () => String.fromCharCode(957);
// ξ
// greek small letter xi
export const xi = () => String.fromCharCode(958);
// ο
// greek small letter omicron
export const omicron = () => String.fromCharCode(959);
// π
// greek small letter pi
export const pi = () => String.fromCharCode(960);
// ρ
// greek small letter rho
export const rho = () => String.fromCharCode(961);
// ς
// greek small letter final sigma
export const sigmaf = () => String.fromCharCode(962);
// σ
// greek small letter sigma
export const sigma = () => String.fromCharCode(963);
// τ
// greek small letter tau
export const tau = () => String.fromCharCode(964);
// υ
// greek small letter upsilon
export const upsilon = () => String.fromCharCode(965);
// φ
// greek small letter phi
export const phi = () => String.fromCharCode(966);
// χ
// greek small letter chi
export const chi = () => String.fromCharCode(967);
// ψ
// greek small letter psi
export const psi = () => String.fromCharCode(968);
// ω
// greek small letter omega
export const omega = () => String.fromCharCode(969);
// ϑ
// greek small letter theta symbol
export const thetasym = () => String.fromCharCode(977);
// ϒ
// greek upsilon with hook symbol
export const upsih = () => String.fromCharCode(978);
// ϖ
// greek pi symbol
export const piv = () => String.fromCharCode(982);
/* Punctuation */
// en space
export const ensp = () => String.fromCharCode(8194);
// em space
export const emsp = () => String.fromCharCode(8195);
// thin space
export const thinsp = () => String.fromCharCode(8201);
// zero width non-joiner
export const zwnj = () => String.fromCharCode(8204);
// zero width joiner
export const zwj = () => String.fromCharCode(8205);
// left-to-right mark
export const lrm = () => String.fromCharCode(8206);
// right-to-left mark
export const rlm = () => String.fromCharCode(8207);
// –
// en dash
export const ndash = () => String.fromCharCode(8211);
// —
// em dash
export const mdash = () => String.fromCharCode(8212);
// ‘
// left single quotation mark
export const lsquo = () => String.fromCharCode(8216);
// ’
// right single quotation mark
export const rsquo = () => String.fromCharCode(8217);
// ‚
// single low-9 quotation mark
export const sbquo = () => String.fromCharCode(8218);
// “
// left double quotation mark
export const ldquo = () => String.fromCharCode(8220);
// ”
// right double quotation mark
export const rdquo = () => String.fromCharCode(8221);
// „
// double low-9 quotation mark
export const bdquo = () => String.fromCharCode(8222);
// †
// dagger
export const dagger = () => String.fromCharCode(8224);
// ‡
// double dagger
export const Dagger = () => String.fromCharCode(8225);
// ‰
// per mille sign
export const permil = () => String.fromCharCode(8240);
// ‹
// single left-pointing angle quotation mark. (lsaquo is proposed but not yet ISO standardised);
export const lsaquo = () => String.fromCharCode(8249);
// ›
// single right-pointing angle quotation mark. rsaquo is proposed but not yet ISO standardised
export const rsaquo = () => String.fromCharCode(8250);
/* #General Punctuation */
//
// bullet, a.k.a. black small circle, bullet is NOT the same as bullet operator —
export const bull = () => String.fromCharCode(8226);
// …
// horizontal ellipsis, a.k.a. three dot leader
export const hellip = () => String.fromCharCode(8230);
// ′
// prime, a.k.a. minutes, a.k.a. feet
export const prime = () => String.fromCharCode(8242);
// ″
// double prime, a.k.a. seconds, a.k.a. inches
export const Prime = () => String.fromCharCode(8243);
// ‾
// overline, a.k.a. spacing overscore
export const oline = () => String.fromCharCode(8254);
// ⁄
// fraction slash
export const frasl = () => String.fromCharCode(8260);
/* #Letterlike Symbols */
// ℘
// script capital P, a.k.a. power set, a.k.a. Weierstrass p
export const weierp = () => String.fromCharCode(8472);
// ℑ
// blackletter capital I, a.k.a. imaginary part
export const image = () => String.fromCharCode(8465);
// ℜ
// blackletter capital R, a.k.a. real part symbol
export const real = () => String.fromCharCode(8476);
// ™
// trade mark sign
export const trade = () => String.fromCharCode(8482);
// ℵ
// alef symbol, a.k.a. first transfinite cardinal alef symbol is NOT the same as hebrew letter alef — u+05D0 although the same glyph could be used to depict both characters
export const alefsym = () => String.fromCharCode(8501);
/* Arrows */
// ←
// leftwards arrow
export const larr = () => String.fromCharCode(8592);
// ↑
// upwards arrow
export const uarr = () => String.fromCharCode(8593);
// →
// rightwards arrow
export const rarr = () => String.fromCharCode(8594);
// ↓
// downwards arrow
export const darr = () => String.fromCharCode(8595);
// ↔
// left right arrow
export const harr = () => String.fromCharCode(8596);
// ↵
// downwards arrow with corner leftwards, a.k.a. carriage return
export const crarr = () => String.fromCharCode(8629);
// ⇐
// leftwards double arrow can be used for ‘is implied by’
export const lArr = () => String.fromCharCode(8656);
// ⇑
// upwards double arrow
export const uArr = () => String.fromCharCode(8657);
// ⇒
// rightwards double arrow
export const rArr = () => String.fromCharCode(8658);
// ⇓
// downwards double arrow
export const dArr = () => String.fromCharCode(8659);
// ⇔
// left right double arrow
export const hArr = () => String.fromCharCode(8660);
/* Mathematical Operators */
// ∀
// for all
export const forall = () => String.fromCharCode(8704);
// ∂
// partial differential
export const part = () => String.fromCharCode(8706);
// ∃
// there exists
export const exist = () => String.fromCharCode(8707);
// ∅
// empty set, a.k.a. null set, a.k.a. diameter
export const empty = () => String.fromCharCode(8709);
// ∇
// nabla, a.k.a. backward difference
export const nabla = () => String.fromCharCode(8711);
// ∈
// element of
export const isin = () => String.fromCharCode(8712);
// ∉
// not an element of
export const notin = () => String.fromCharCode(8713);
// ∋
// contains as member
export const ni = () => String.fromCharCode(8715);
// ∏
// n-ary product, a.k.a. product sign prod is NOT the same character as u+03A0 ‘greek capital letter pi’ though the same glyph might be used for both
export const prod = () => String.fromCharCode(8719);
//
//
export const sum = () => String.fromCharCode(8721);
// −
// minus sign
export const minus = () => String.fromCharCode(8722);
// ∗
// asterisk operator
export const lowast = () => String.fromCharCode(8727);
// √
// square root, a.k.a. radical sign
export const radic = () => String.fromCharCode(8730);
// ∝
// proportional to
export const prop = () => String.fromCharCode(8733);
// ∞
// infinity
export const infin = () => String.fromCharCode(8734);
// ∠
// angle
export const ang = () => String.fromCharCode(8736);
// ⊥
// logical and, a.k.a. wedge
export const and = () => String.fromCharCode(8869);
// ⊦
// logical or, a.k.a. vee
export const or = () => String.fromCharCode(8870);
// ∩
// intersection, a.k.a. cap
export const cap = () => String.fromCharCode(8745);
// ∪
// union, a.k.a. cup
export const cup = () => String.fromCharCode(8746);
// ∫
// integral
export const int = () => String.fromCharCode(8747);
// ∴
// therefore
export const there4 = () => String.fromCharCode(8756);
// ∼
// tilde operator, a.k.a. varies with, similar to tilde operator, but is NOT the same character as the tilde u+007E, although the same glyph might be used to represent both
export const sim = () => String.fromCharCode(8764);
// ≅
// approximately equal to
export const cong = () => String.fromCharCode(8773);
// ≈
// almost equal to, a.k.a. asymptotic to
export const asymp = () => String.fromCharCode(8776);
// ≠
// not equal to
export const ne = () => String.fromCharCode(8800);
// ≡
// identical to
export const equiv = () => String.fromCharCode(8801);
// ≤
// less-than or equal to
export const le = () => String.fromCharCode(8804);
// ≥
// greater-than or equal to
export const ge = () => String.fromCharCode(8805);
// ⊂
// subset of
export const sub = () => String.fromCharCode(8834);
// ⊃
// superset of note that nsup, ‘not a superset of u+2283′ is not covered by the Symbol font encoding and is not included.
export const sup = () => String.fromCharCode(8835);
// ⊄
// not a subset of
export const nsub = () => String.fromCharCode(8836);
// ⊆
// subset of or equal to
export const sube = () => String.fromCharCode(8838);
// ⊇
// superset of or equal to
export const supe = () => String.fromCharCode(8839);
// ⊕
// circled plus, a.k.a. direct sum
export const oplus = () => String.fromCharCode(8853);
// ⊗
// circled times, a.k.a. vector product
export const otimes = () => String.fromCharCode(8855);
// ⊥
// up tack, a.k.a. orthogonal to, a.k.a. perpendicular
export const perp = () => String.fromCharCode(8869);
// ⋅
// dot operator is NOT the same character as u+00B7 middle dot
export const sdot = () => String.fromCharCode(8901);
/* Miscellaneous Technical */
// ⌈
// left ceiling, a.k.a. apl upstile
export const lceil = () => String.fromCharCode(8968);
// ⌉
// right ceiling
export const rceil = () => String.fromCharCode(8969);
// ⌊
// left floor, a.k.a. apl downstile
export const lfloor = () => String.fromCharCode(8970);
// ⌋
// right floor
export const rfloor = () => String.fromCharCode(8971);
// 〈
// left-pointing angle bracket, a.k.a. bra lang is NOT the same character as u+003C ‘less than’ or u+2039 ’single left-pointing angle quotation mark’
export const lang = () => String.fromCharCode(9001);
// 〉
// right-pointing angle bracket, a.k.a. ket rang is NOT the same character as u+003E ‘greater than’ or u+203A ’single right-pointing angle quotation mark’
export const rang = () => String.fromCharCode(9001);
/* Geometric Shapes */
// ◊
// lozenge
export const loz = () => String.fromCharCode(9674);
/* Miscellaneous Symbols */
// ♠
// black spade suit
export const spades = () => String.fromCharCode(9824);
// ♣
// black club suit, a.k.a. shamrock
export const clubs = () => String.fromCharCode(9827);
// ♥
// black heart suit, a.k.a. valentine
export const hearts = () => String.fromCharCode(9829);
// ♦
// black diamond suit
export const diams = () => String.fromCharCode(9830);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment