logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

compat.py (102726B)


  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from __future__ import division
  4. import base64
  5. import binascii
  6. import collections
  7. import ctypes
  8. import datetime
  9. import email
  10. import getpass
  11. import io
  12. import itertools
  13. import optparse
  14. import os
  15. import platform
  16. import re
  17. import shlex
  18. import shutil
  19. import socket
  20. import struct
  21. import subprocess
  22. import sys
  23. import types
  24. import xml.etree.ElementTree
  25. # naming convention
  26. # 'compat_' + Python3_name.replace('.', '_')
  27. # other aliases exist for convenience and/or legacy
  28. # deal with critical unicode/str things first
  29. try:
  30. # Python 2
  31. compat_str, compat_basestring, compat_chr = (
  32. unicode, basestring, unichr
  33. )
  34. except NameError:
  35. compat_str, compat_basestring, compat_chr = (
  36. str, (str, bytes), chr
  37. )
  38. # casefold
  39. try:
  40. compat_str.casefold
  41. compat_casefold = lambda s: s.casefold()
  42. except AttributeError:
  43. from .casefold import casefold as compat_casefold
  44. try:
  45. import collections.abc as compat_collections_abc
  46. except ImportError:
  47. import collections as compat_collections_abc
  48. try:
  49. import urllib.request as compat_urllib_request
  50. except ImportError: # Python 2
  51. import urllib2 as compat_urllib_request
  52. # Also fix up lack of method arg in old Pythons
  53. try:
  54. type(compat_urllib_request.Request('http://127.0.0.1', method='GET'))
  55. except TypeError:
  56. def _add_init_method_arg(cls):
  57. init = cls.__init__
  58. def wrapped_init(self, *args, **kwargs):
  59. method = kwargs.pop('method', 'GET')
  60. init(self, *args, **kwargs)
  61. if any(callable(x.__dict__.get('get_method')) for x in (self.__class__, self) if x != cls):
  62. # allow instance or its subclass to override get_method()
  63. return
  64. if self.has_data() and method == 'GET':
  65. method = 'POST'
  66. self.get_method = types.MethodType(lambda _: method, self)
  67. cls.__init__ = wrapped_init
  68. _add_init_method_arg(compat_urllib_request.Request)
  69. del _add_init_method_arg
  70. try:
  71. import urllib.error as compat_urllib_error
  72. except ImportError: # Python 2
  73. import urllib2 as compat_urllib_error
  74. try:
  75. import urllib.parse as compat_urllib_parse
  76. except ImportError: # Python 2
  77. import urllib as compat_urllib_parse
  78. import urlparse as _urlparse
  79. for a in dir(_urlparse):
  80. if not hasattr(compat_urllib_parse, a):
  81. setattr(compat_urllib_parse, a, getattr(_urlparse, a))
  82. del _urlparse
  83. # unfavoured aliases
  84. compat_urlparse = compat_urllib_parse
  85. compat_urllib_parse_urlparse = compat_urllib_parse.urlparse
  86. try:
  87. import urllib.response as compat_urllib_response
  88. except ImportError: # Python 2
  89. import urllib as compat_urllib_response
  90. try:
  91. compat_urllib_response.addinfourl.status
  92. except AttributeError:
  93. # .getcode() is deprecated in Py 3.
  94. compat_urllib_response.addinfourl.status = property(lambda self: self.getcode())
  95. try:
  96. import http.cookiejar as compat_cookiejar
  97. except ImportError: # Python 2
  98. import cookielib as compat_cookiejar
  99. compat_http_cookiejar = compat_cookiejar
  100. if sys.version_info[0] == 2:
  101. class compat_cookiejar_Cookie(compat_cookiejar.Cookie):
  102. def __init__(self, version, name, value, *args, **kwargs):
  103. if isinstance(name, compat_str):
  104. name = name.encode()
  105. if isinstance(value, compat_str):
  106. value = value.encode()
  107. compat_cookiejar.Cookie.__init__(self, version, name, value, *args, **kwargs)
  108. else:
  109. compat_cookiejar_Cookie = compat_cookiejar.Cookie
  110. compat_http_cookiejar_Cookie = compat_cookiejar_Cookie
  111. try:
  112. import http.cookies as compat_cookies
  113. except ImportError: # Python 2
  114. import Cookie as compat_cookies
  115. compat_http_cookies = compat_cookies
  116. if sys.version_info[0] == 2 or sys.version_info < (3, 3):
  117. class compat_cookies_SimpleCookie(compat_cookies.SimpleCookie):
  118. def load(self, rawdata):
  119. must_have_value = 0
  120. if not isinstance(rawdata, dict):
  121. if sys.version_info[:2] != (2, 7) or sys.platform.startswith('java'):
  122. # attribute must have value for parsing
  123. rawdata, must_have_value = re.subn(
  124. r'(?i)(;\s*)(secure|httponly)(\s*(?:;|$))', r'\1\2=\2\3', rawdata)
  125. if sys.version_info[0] == 2:
  126. if isinstance(rawdata, compat_str):
  127. rawdata = str(rawdata)
  128. super(compat_cookies_SimpleCookie, self).load(rawdata)
  129. if must_have_value > 0:
  130. for morsel in self.values():
  131. for attr in ('secure', 'httponly'):
  132. if morsel.get(attr):
  133. morsel[attr] = True
  134. else:
  135. compat_cookies_SimpleCookie = compat_cookies.SimpleCookie
  136. compat_http_cookies_SimpleCookie = compat_cookies_SimpleCookie
  137. try:
  138. import html.entities as compat_html_entities
  139. except ImportError: # Python 2
  140. import htmlentitydefs as compat_html_entities
  141. try: # Python >= 3.3
  142. compat_html_entities_html5 = compat_html_entities.html5
  143. except AttributeError:
  144. # Copied from CPython 3.5.1 html/entities.py
  145. compat_html_entities_html5 = {
  146. 'Aacute': '\xc1',
  147. 'aacute': '\xe1',
  148. 'Aacute;': '\xc1',
  149. 'aacute;': '\xe1',
  150. 'Abreve;': '\u0102',
  151. 'abreve;': '\u0103',
  152. 'ac;': '\u223e',
  153. 'acd;': '\u223f',
  154. 'acE;': '\u223e\u0333',
  155. 'Acirc': '\xc2',
  156. 'acirc': '\xe2',
  157. 'Acirc;': '\xc2',
  158. 'acirc;': '\xe2',
  159. 'acute': '\xb4',
  160. 'acute;': '\xb4',
  161. 'Acy;': '\u0410',
  162. 'acy;': '\u0430',
  163. 'AElig': '\xc6',
  164. 'aelig': '\xe6',
  165. 'AElig;': '\xc6',
  166. 'aelig;': '\xe6',
  167. 'af;': '\u2061',
  168. 'Afr;': '\U0001d504',
  169. 'afr;': '\U0001d51e',
  170. 'Agrave': '\xc0',
  171. 'agrave': '\xe0',
  172. 'Agrave;': '\xc0',
  173. 'agrave;': '\xe0',
  174. 'alefsym;': '\u2135',
  175. 'aleph;': '\u2135',
  176. 'Alpha;': '\u0391',
  177. 'alpha;': '\u03b1',
  178. 'Amacr;': '\u0100',
  179. 'amacr;': '\u0101',
  180. 'amalg;': '\u2a3f',
  181. 'AMP': '&',
  182. 'amp': '&',
  183. 'AMP;': '&',
  184. 'amp;': '&',
  185. 'And;': '\u2a53',
  186. 'and;': '\u2227',
  187. 'andand;': '\u2a55',
  188. 'andd;': '\u2a5c',
  189. 'andslope;': '\u2a58',
  190. 'andv;': '\u2a5a',
  191. 'ang;': '\u2220',
  192. 'ange;': '\u29a4',
  193. 'angle;': '\u2220',
  194. 'angmsd;': '\u2221',
  195. 'angmsdaa;': '\u29a8',
  196. 'angmsdab;': '\u29a9',
  197. 'angmsdac;': '\u29aa',
  198. 'angmsdad;': '\u29ab',
  199. 'angmsdae;': '\u29ac',
  200. 'angmsdaf;': '\u29ad',
  201. 'angmsdag;': '\u29ae',
  202. 'angmsdah;': '\u29af',
  203. 'angrt;': '\u221f',
  204. 'angrtvb;': '\u22be',
  205. 'angrtvbd;': '\u299d',
  206. 'angsph;': '\u2222',
  207. 'angst;': '\xc5',
  208. 'angzarr;': '\u237c',
  209. 'Aogon;': '\u0104',
  210. 'aogon;': '\u0105',
  211. 'Aopf;': '\U0001d538',
  212. 'aopf;': '\U0001d552',
  213. 'ap;': '\u2248',
  214. 'apacir;': '\u2a6f',
  215. 'apE;': '\u2a70',
  216. 'ape;': '\u224a',
  217. 'apid;': '\u224b',
  218. 'apos;': "'",
  219. 'ApplyFunction;': '\u2061',
  220. 'approx;': '\u2248',
  221. 'approxeq;': '\u224a',
  222. 'Aring': '\xc5',
  223. 'aring': '\xe5',
  224. 'Aring;': '\xc5',
  225. 'aring;': '\xe5',
  226. 'Ascr;': '\U0001d49c',
  227. 'ascr;': '\U0001d4b6',
  228. 'Assign;': '\u2254',
  229. 'ast;': '*',
  230. 'asymp;': '\u2248',
  231. 'asympeq;': '\u224d',
  232. 'Atilde': '\xc3',
  233. 'atilde': '\xe3',
  234. 'Atilde;': '\xc3',
  235. 'atilde;': '\xe3',
  236. 'Auml': '\xc4',
  237. 'auml': '\xe4',
  238. 'Auml;': '\xc4',
  239. 'auml;': '\xe4',
  240. 'awconint;': '\u2233',
  241. 'awint;': '\u2a11',
  242. 'backcong;': '\u224c',
  243. 'backepsilon;': '\u03f6',
  244. 'backprime;': '\u2035',
  245. 'backsim;': '\u223d',
  246. 'backsimeq;': '\u22cd',
  247. 'Backslash;': '\u2216',
  248. 'Barv;': '\u2ae7',
  249. 'barvee;': '\u22bd',
  250. 'Barwed;': '\u2306',
  251. 'barwed;': '\u2305',
  252. 'barwedge;': '\u2305',
  253. 'bbrk;': '\u23b5',
  254. 'bbrktbrk;': '\u23b6',
  255. 'bcong;': '\u224c',
  256. 'Bcy;': '\u0411',
  257. 'bcy;': '\u0431',
  258. 'bdquo;': '\u201e',
  259. 'becaus;': '\u2235',
  260. 'Because;': '\u2235',
  261. 'because;': '\u2235',
  262. 'bemptyv;': '\u29b0',
  263. 'bepsi;': '\u03f6',
  264. 'bernou;': '\u212c',
  265. 'Bernoullis;': '\u212c',
  266. 'Beta;': '\u0392',
  267. 'beta;': '\u03b2',
  268. 'beth;': '\u2136',
  269. 'between;': '\u226c',
  270. 'Bfr;': '\U0001d505',
  271. 'bfr;': '\U0001d51f',
  272. 'bigcap;': '\u22c2',
  273. 'bigcirc;': '\u25ef',
  274. 'bigcup;': '\u22c3',
  275. 'bigodot;': '\u2a00',
  276. 'bigoplus;': '\u2a01',
  277. 'bigotimes;': '\u2a02',
  278. 'bigsqcup;': '\u2a06',
  279. 'bigstar;': '\u2605',
  280. 'bigtriangledown;': '\u25bd',
  281. 'bigtriangleup;': '\u25b3',
  282. 'biguplus;': '\u2a04',
  283. 'bigvee;': '\u22c1',
  284. 'bigwedge;': '\u22c0',
  285. 'bkarow;': '\u290d',
  286. 'blacklozenge;': '\u29eb',
  287. 'blacksquare;': '\u25aa',
  288. 'blacktriangle;': '\u25b4',
  289. 'blacktriangledown;': '\u25be',
  290. 'blacktriangleleft;': '\u25c2',
  291. 'blacktriangleright;': '\u25b8',
  292. 'blank;': '\u2423',
  293. 'blk12;': '\u2592',
  294. 'blk14;': '\u2591',
  295. 'blk34;': '\u2593',
  296. 'block;': '\u2588',
  297. 'bne;': '=\u20e5',
  298. 'bnequiv;': '\u2261\u20e5',
  299. 'bNot;': '\u2aed',
  300. 'bnot;': '\u2310',
  301. 'Bopf;': '\U0001d539',
  302. 'bopf;': '\U0001d553',
  303. 'bot;': '\u22a5',
  304. 'bottom;': '\u22a5',
  305. 'bowtie;': '\u22c8',
  306. 'boxbox;': '\u29c9',
  307. 'boxDL;': '\u2557',
  308. 'boxDl;': '\u2556',
  309. 'boxdL;': '\u2555',
  310. 'boxdl;': '\u2510',
  311. 'boxDR;': '\u2554',
  312. 'boxDr;': '\u2553',
  313. 'boxdR;': '\u2552',
  314. 'boxdr;': '\u250c',
  315. 'boxH;': '\u2550',
  316. 'boxh;': '\u2500',
  317. 'boxHD;': '\u2566',
  318. 'boxHd;': '\u2564',
  319. 'boxhD;': '\u2565',
  320. 'boxhd;': '\u252c',
  321. 'boxHU;': '\u2569',
  322. 'boxHu;': '\u2567',
  323. 'boxhU;': '\u2568',
  324. 'boxhu;': '\u2534',
  325. 'boxminus;': '\u229f',
  326. 'boxplus;': '\u229e',
  327. 'boxtimes;': '\u22a0',
  328. 'boxUL;': '\u255d',
  329. 'boxUl;': '\u255c',
  330. 'boxuL;': '\u255b',
  331. 'boxul;': '\u2518',
  332. 'boxUR;': '\u255a',
  333. 'boxUr;': '\u2559',
  334. 'boxuR;': '\u2558',
  335. 'boxur;': '\u2514',
  336. 'boxV;': '\u2551',
  337. 'boxv;': '\u2502',
  338. 'boxVH;': '\u256c',
  339. 'boxVh;': '\u256b',
  340. 'boxvH;': '\u256a',
  341. 'boxvh;': '\u253c',
  342. 'boxVL;': '\u2563',
  343. 'boxVl;': '\u2562',
  344. 'boxvL;': '\u2561',
  345. 'boxvl;': '\u2524',
  346. 'boxVR;': '\u2560',
  347. 'boxVr;': '\u255f',
  348. 'boxvR;': '\u255e',
  349. 'boxvr;': '\u251c',
  350. 'bprime;': '\u2035',
  351. 'Breve;': '\u02d8',
  352. 'breve;': '\u02d8',
  353. 'brvbar': '\xa6',
  354. 'brvbar;': '\xa6',
  355. 'Bscr;': '\u212c',
  356. 'bscr;': '\U0001d4b7',
  357. 'bsemi;': '\u204f',
  358. 'bsim;': '\u223d',
  359. 'bsime;': '\u22cd',
  360. 'bsol;': '\\',
  361. 'bsolb;': '\u29c5',
  362. 'bsolhsub;': '\u27c8',
  363. 'bull;': '\u2022',
  364. 'bullet;': '\u2022',
  365. 'bump;': '\u224e',
  366. 'bumpE;': '\u2aae',
  367. 'bumpe;': '\u224f',
  368. 'Bumpeq;': '\u224e',
  369. 'bumpeq;': '\u224f',
  370. 'Cacute;': '\u0106',
  371. 'cacute;': '\u0107',
  372. 'Cap;': '\u22d2',
  373. 'cap;': '\u2229',
  374. 'capand;': '\u2a44',
  375. 'capbrcup;': '\u2a49',
  376. 'capcap;': '\u2a4b',
  377. 'capcup;': '\u2a47',
  378. 'capdot;': '\u2a40',
  379. 'CapitalDifferentialD;': '\u2145',
  380. 'caps;': '\u2229\ufe00',
  381. 'caret;': '\u2041',
  382. 'caron;': '\u02c7',
  383. 'Cayleys;': '\u212d',
  384. 'ccaps;': '\u2a4d',
  385. 'Ccaron;': '\u010c',
  386. 'ccaron;': '\u010d',
  387. 'Ccedil': '\xc7',
  388. 'ccedil': '\xe7',
  389. 'Ccedil;': '\xc7',
  390. 'ccedil;': '\xe7',
  391. 'Ccirc;': '\u0108',
  392. 'ccirc;': '\u0109',
  393. 'Cconint;': '\u2230',
  394. 'ccups;': '\u2a4c',
  395. 'ccupssm;': '\u2a50',
  396. 'Cdot;': '\u010a',
  397. 'cdot;': '\u010b',
  398. 'cedil': '\xb8',
  399. 'cedil;': '\xb8',
  400. 'Cedilla;': '\xb8',
  401. 'cemptyv;': '\u29b2',
  402. 'cent': '\xa2',
  403. 'cent;': '\xa2',
  404. 'CenterDot;': '\xb7',
  405. 'centerdot;': '\xb7',
  406. 'Cfr;': '\u212d',
  407. 'cfr;': '\U0001d520',
  408. 'CHcy;': '\u0427',
  409. 'chcy;': '\u0447',
  410. 'check;': '\u2713',
  411. 'checkmark;': '\u2713',
  412. 'Chi;': '\u03a7',
  413. 'chi;': '\u03c7',
  414. 'cir;': '\u25cb',
  415. 'circ;': '\u02c6',
  416. 'circeq;': '\u2257',
  417. 'circlearrowleft;': '\u21ba',
  418. 'circlearrowright;': '\u21bb',
  419. 'circledast;': '\u229b',
  420. 'circledcirc;': '\u229a',
  421. 'circleddash;': '\u229d',
  422. 'CircleDot;': '\u2299',
  423. 'circledR;': '\xae',
  424. 'circledS;': '\u24c8',
  425. 'CircleMinus;': '\u2296',
  426. 'CirclePlus;': '\u2295',
  427. 'CircleTimes;': '\u2297',
  428. 'cirE;': '\u29c3',
  429. 'cire;': '\u2257',
  430. 'cirfnint;': '\u2a10',
  431. 'cirmid;': '\u2aef',
  432. 'cirscir;': '\u29c2',
  433. 'ClockwiseContourIntegral;': '\u2232',
  434. 'CloseCurlyDoubleQuote;': '\u201d',
  435. 'CloseCurlyQuote;': '\u2019',
  436. 'clubs;': '\u2663',
  437. 'clubsuit;': '\u2663',
  438. 'Colon;': '\u2237',
  439. 'colon;': ':',
  440. 'Colone;': '\u2a74',
  441. 'colone;': '\u2254',
  442. 'coloneq;': '\u2254',
  443. 'comma;': ',',
  444. 'commat;': '@',
  445. 'comp;': '\u2201',
  446. 'compfn;': '\u2218',
  447. 'complement;': '\u2201',
  448. 'complexes;': '\u2102',
  449. 'cong;': '\u2245',
  450. 'congdot;': '\u2a6d',
  451. 'Congruent;': '\u2261',
  452. 'Conint;': '\u222f',
  453. 'conint;': '\u222e',
  454. 'ContourIntegral;': '\u222e',
  455. 'Copf;': '\u2102',
  456. 'copf;': '\U0001d554',
  457. 'coprod;': '\u2210',
  458. 'Coproduct;': '\u2210',
  459. 'COPY': '\xa9',
  460. 'copy': '\xa9',
  461. 'COPY;': '\xa9',
  462. 'copy;': '\xa9',
  463. 'copysr;': '\u2117',
  464. 'CounterClockwiseContourIntegral;': '\u2233',
  465. 'crarr;': '\u21b5',
  466. 'Cross;': '\u2a2f',
  467. 'cross;': '\u2717',
  468. 'Cscr;': '\U0001d49e',
  469. 'cscr;': '\U0001d4b8',
  470. 'csub;': '\u2acf',
  471. 'csube;': '\u2ad1',
  472. 'csup;': '\u2ad0',
  473. 'csupe;': '\u2ad2',
  474. 'ctdot;': '\u22ef',
  475. 'cudarrl;': '\u2938',
  476. 'cudarrr;': '\u2935',
  477. 'cuepr;': '\u22de',
  478. 'cuesc;': '\u22df',
  479. 'cularr;': '\u21b6',
  480. 'cularrp;': '\u293d',
  481. 'Cup;': '\u22d3',
  482. 'cup;': '\u222a',
  483. 'cupbrcap;': '\u2a48',
  484. 'CupCap;': '\u224d',
  485. 'cupcap;': '\u2a46',
  486. 'cupcup;': '\u2a4a',
  487. 'cupdot;': '\u228d',
  488. 'cupor;': '\u2a45',
  489. 'cups;': '\u222a\ufe00',
  490. 'curarr;': '\u21b7',
  491. 'curarrm;': '\u293c',
  492. 'curlyeqprec;': '\u22de',
  493. 'curlyeqsucc;': '\u22df',
  494. 'curlyvee;': '\u22ce',
  495. 'curlywedge;': '\u22cf',
  496. 'curren': '\xa4',
  497. 'curren;': '\xa4',
  498. 'curvearrowleft;': '\u21b6',
  499. 'curvearrowright;': '\u21b7',
  500. 'cuvee;': '\u22ce',
  501. 'cuwed;': '\u22cf',
  502. 'cwconint;': '\u2232',
  503. 'cwint;': '\u2231',
  504. 'cylcty;': '\u232d',
  505. 'Dagger;': '\u2021',
  506. 'dagger;': '\u2020',
  507. 'daleth;': '\u2138',
  508. 'Darr;': '\u21a1',
  509. 'dArr;': '\u21d3',
  510. 'darr;': '\u2193',
  511. 'dash;': '\u2010',
  512. 'Dashv;': '\u2ae4',
  513. 'dashv;': '\u22a3',
  514. 'dbkarow;': '\u290f',
  515. 'dblac;': '\u02dd',
  516. 'Dcaron;': '\u010e',
  517. 'dcaron;': '\u010f',
  518. 'Dcy;': '\u0414',
  519. 'dcy;': '\u0434',
  520. 'DD;': '\u2145',
  521. 'dd;': '\u2146',
  522. 'ddagger;': '\u2021',
  523. 'ddarr;': '\u21ca',
  524. 'DDotrahd;': '\u2911',
  525. 'ddotseq;': '\u2a77',
  526. 'deg': '\xb0',
  527. 'deg;': '\xb0',
  528. 'Del;': '\u2207',
  529. 'Delta;': '\u0394',
  530. 'delta;': '\u03b4',
  531. 'demptyv;': '\u29b1',
  532. 'dfisht;': '\u297f',
  533. 'Dfr;': '\U0001d507',
  534. 'dfr;': '\U0001d521',
  535. 'dHar;': '\u2965',
  536. 'dharl;': '\u21c3',
  537. 'dharr;': '\u21c2',
  538. 'DiacriticalAcute;': '\xb4',
  539. 'DiacriticalDot;': '\u02d9',
  540. 'DiacriticalDoubleAcute;': '\u02dd',
  541. 'DiacriticalGrave;': '`',
  542. 'DiacriticalTilde;': '\u02dc',
  543. 'diam;': '\u22c4',
  544. 'Diamond;': '\u22c4',
  545. 'diamond;': '\u22c4',
  546. 'diamondsuit;': '\u2666',
  547. 'diams;': '\u2666',
  548. 'die;': '\xa8',
  549. 'DifferentialD;': '\u2146',
  550. 'digamma;': '\u03dd',
  551. 'disin;': '\u22f2',
  552. 'div;': '\xf7',
  553. 'divide': '\xf7',
  554. 'divide;': '\xf7',
  555. 'divideontimes;': '\u22c7',
  556. 'divonx;': '\u22c7',
  557. 'DJcy;': '\u0402',
  558. 'djcy;': '\u0452',
  559. 'dlcorn;': '\u231e',
  560. 'dlcrop;': '\u230d',
  561. 'dollar;': '$',
  562. 'Dopf;': '\U0001d53b',
  563. 'dopf;': '\U0001d555',
  564. 'Dot;': '\xa8',
  565. 'dot;': '\u02d9',
  566. 'DotDot;': '\u20dc',
  567. 'doteq;': '\u2250',
  568. 'doteqdot;': '\u2251',
  569. 'DotEqual;': '\u2250',
  570. 'dotminus;': '\u2238',
  571. 'dotplus;': '\u2214',
  572. 'dotsquare;': '\u22a1',
  573. 'doublebarwedge;': '\u2306',
  574. 'DoubleContourIntegral;': '\u222f',
  575. 'DoubleDot;': '\xa8',
  576. 'DoubleDownArrow;': '\u21d3',
  577. 'DoubleLeftArrow;': '\u21d0',
  578. 'DoubleLeftRightArrow;': '\u21d4',
  579. 'DoubleLeftTee;': '\u2ae4',
  580. 'DoubleLongLeftArrow;': '\u27f8',
  581. 'DoubleLongLeftRightArrow;': '\u27fa',
  582. 'DoubleLongRightArrow;': '\u27f9',
  583. 'DoubleRightArrow;': '\u21d2',
  584. 'DoubleRightTee;': '\u22a8',
  585. 'DoubleUpArrow;': '\u21d1',
  586. 'DoubleUpDownArrow;': '\u21d5',
  587. 'DoubleVerticalBar;': '\u2225',
  588. 'DownArrow;': '\u2193',
  589. 'Downarrow;': '\u21d3',
  590. 'downarrow;': '\u2193',
  591. 'DownArrowBar;': '\u2913',
  592. 'DownArrowUpArrow;': '\u21f5',
  593. 'DownBreve;': '\u0311',
  594. 'downdownarrows;': '\u21ca',
  595. 'downharpoonleft;': '\u21c3',
  596. 'downharpoonright;': '\u21c2',
  597. 'DownLeftRightVector;': '\u2950',
  598. 'DownLeftTeeVector;': '\u295e',
  599. 'DownLeftVector;': '\u21bd',
  600. 'DownLeftVectorBar;': '\u2956',
  601. 'DownRightTeeVector;': '\u295f',
  602. 'DownRightVector;': '\u21c1',
  603. 'DownRightVectorBar;': '\u2957',
  604. 'DownTee;': '\u22a4',
  605. 'DownTeeArrow;': '\u21a7',
  606. 'drbkarow;': '\u2910',
  607. 'drcorn;': '\u231f',
  608. 'drcrop;': '\u230c',
  609. 'Dscr;': '\U0001d49f',
  610. 'dscr;': '\U0001d4b9',
  611. 'DScy;': '\u0405',
  612. 'dscy;': '\u0455',
  613. 'dsol;': '\u29f6',
  614. 'Dstrok;': '\u0110',
  615. 'dstrok;': '\u0111',
  616. 'dtdot;': '\u22f1',
  617. 'dtri;': '\u25bf',
  618. 'dtrif;': '\u25be',
  619. 'duarr;': '\u21f5',
  620. 'duhar;': '\u296f',
  621. 'dwangle;': '\u29a6',
  622. 'DZcy;': '\u040f',
  623. 'dzcy;': '\u045f',
  624. 'dzigrarr;': '\u27ff',
  625. 'Eacute': '\xc9',
  626. 'eacute': '\xe9',
  627. 'Eacute;': '\xc9',
  628. 'eacute;': '\xe9',
  629. 'easter;': '\u2a6e',
  630. 'Ecaron;': '\u011a',
  631. 'ecaron;': '\u011b',
  632. 'ecir;': '\u2256',
  633. 'Ecirc': '\xca',
  634. 'ecirc': '\xea',
  635. 'Ecirc;': '\xca',
  636. 'ecirc;': '\xea',
  637. 'ecolon;': '\u2255',
  638. 'Ecy;': '\u042d',
  639. 'ecy;': '\u044d',
  640. 'eDDot;': '\u2a77',
  641. 'Edot;': '\u0116',
  642. 'eDot;': '\u2251',
  643. 'edot;': '\u0117',
  644. 'ee;': '\u2147',
  645. 'efDot;': '\u2252',
  646. 'Efr;': '\U0001d508',
  647. 'efr;': '\U0001d522',
  648. 'eg;': '\u2a9a',
  649. 'Egrave': '\xc8',
  650. 'egrave': '\xe8',
  651. 'Egrave;': '\xc8',
  652. 'egrave;': '\xe8',
  653. 'egs;': '\u2a96',
  654. 'egsdot;': '\u2a98',
  655. 'el;': '\u2a99',
  656. 'Element;': '\u2208',
  657. 'elinters;': '\u23e7',
  658. 'ell;': '\u2113',
  659. 'els;': '\u2a95',
  660. 'elsdot;': '\u2a97',
  661. 'Emacr;': '\u0112',
  662. 'emacr;': '\u0113',
  663. 'empty;': '\u2205',
  664. 'emptyset;': '\u2205',
  665. 'EmptySmallSquare;': '\u25fb',
  666. 'emptyv;': '\u2205',
  667. 'EmptyVerySmallSquare;': '\u25ab',
  668. 'emsp13;': '\u2004',
  669. 'emsp14;': '\u2005',
  670. 'emsp;': '\u2003',
  671. 'ENG;': '\u014a',
  672. 'eng;': '\u014b',
  673. 'ensp;': '\u2002',
  674. 'Eogon;': '\u0118',
  675. 'eogon;': '\u0119',
  676. 'Eopf;': '\U0001d53c',
  677. 'eopf;': '\U0001d556',
  678. 'epar;': '\u22d5',
  679. 'eparsl;': '\u29e3',
  680. 'eplus;': '\u2a71',
  681. 'epsi;': '\u03b5',
  682. 'Epsilon;': '\u0395',
  683. 'epsilon;': '\u03b5',
  684. 'epsiv;': '\u03f5',
  685. 'eqcirc;': '\u2256',
  686. 'eqcolon;': '\u2255',
  687. 'eqsim;': '\u2242',
  688. 'eqslantgtr;': '\u2a96',
  689. 'eqslantless;': '\u2a95',
  690. 'Equal;': '\u2a75',
  691. 'equals;': '=',
  692. 'EqualTilde;': '\u2242',
  693. 'equest;': '\u225f',
  694. 'Equilibrium;': '\u21cc',
  695. 'equiv;': '\u2261',
  696. 'equivDD;': '\u2a78',
  697. 'eqvparsl;': '\u29e5',
  698. 'erarr;': '\u2971',
  699. 'erDot;': '\u2253',
  700. 'Escr;': '\u2130',
  701. 'escr;': '\u212f',
  702. 'esdot;': '\u2250',
  703. 'Esim;': '\u2a73',
  704. 'esim;': '\u2242',
  705. 'Eta;': '\u0397',
  706. 'eta;': '\u03b7',
  707. 'ETH': '\xd0',
  708. 'eth': '\xf0',
  709. 'ETH;': '\xd0',
  710. 'eth;': '\xf0',
  711. 'Euml': '\xcb',
  712. 'euml': '\xeb',
  713. 'Euml;': '\xcb',
  714. 'euml;': '\xeb',
  715. 'euro;': '\u20ac',
  716. 'excl;': '!',
  717. 'exist;': '\u2203',
  718. 'Exists;': '\u2203',
  719. 'expectation;': '\u2130',
  720. 'ExponentialE;': '\u2147',
  721. 'exponentiale;': '\u2147',
  722. 'fallingdotseq;': '\u2252',
  723. 'Fcy;': '\u0424',
  724. 'fcy;': '\u0444',
  725. 'female;': '\u2640',
  726. 'ffilig;': '\ufb03',
  727. 'fflig;': '\ufb00',
  728. 'ffllig;': '\ufb04',
  729. 'Ffr;': '\U0001d509',
  730. 'ffr;': '\U0001d523',
  731. 'filig;': '\ufb01',
  732. 'FilledSmallSquare;': '\u25fc',
  733. 'FilledVerySmallSquare;': '\u25aa',
  734. 'fjlig;': 'fj',
  735. 'flat;': '\u266d',
  736. 'fllig;': '\ufb02',
  737. 'fltns;': '\u25b1',
  738. 'fnof;': '\u0192',
  739. 'Fopf;': '\U0001d53d',
  740. 'fopf;': '\U0001d557',
  741. 'ForAll;': '\u2200',
  742. 'forall;': '\u2200',
  743. 'fork;': '\u22d4',
  744. 'forkv;': '\u2ad9',
  745. 'Fouriertrf;': '\u2131',
  746. 'fpartint;': '\u2a0d',
  747. 'frac12': '\xbd',
  748. 'frac12;': '\xbd',
  749. 'frac13;': '\u2153',
  750. 'frac14': '\xbc',
  751. 'frac14;': '\xbc',
  752. 'frac15;': '\u2155',
  753. 'frac16;': '\u2159',
  754. 'frac18;': '\u215b',
  755. 'frac23;': '\u2154',
  756. 'frac25;': '\u2156',
  757. 'frac34': '\xbe',
  758. 'frac34;': '\xbe',
  759. 'frac35;': '\u2157',
  760. 'frac38;': '\u215c',
  761. 'frac45;': '\u2158',
  762. 'frac56;': '\u215a',
  763. 'frac58;': '\u215d',
  764. 'frac78;': '\u215e',
  765. 'frasl;': '\u2044',
  766. 'frown;': '\u2322',
  767. 'Fscr;': '\u2131',
  768. 'fscr;': '\U0001d4bb',
  769. 'gacute;': '\u01f5',
  770. 'Gamma;': '\u0393',
  771. 'gamma;': '\u03b3',
  772. 'Gammad;': '\u03dc',
  773. 'gammad;': '\u03dd',
  774. 'gap;': '\u2a86',
  775. 'Gbreve;': '\u011e',
  776. 'gbreve;': '\u011f',
  777. 'Gcedil;': '\u0122',
  778. 'Gcirc;': '\u011c',
  779. 'gcirc;': '\u011d',
  780. 'Gcy;': '\u0413',
  781. 'gcy;': '\u0433',
  782. 'Gdot;': '\u0120',
  783. 'gdot;': '\u0121',
  784. 'gE;': '\u2267',
  785. 'ge;': '\u2265',
  786. 'gEl;': '\u2a8c',
  787. 'gel;': '\u22db',
  788. 'geq;': '\u2265',
  789. 'geqq;': '\u2267',
  790. 'geqslant;': '\u2a7e',
  791. 'ges;': '\u2a7e',
  792. 'gescc;': '\u2aa9',
  793. 'gesdot;': '\u2a80',
  794. 'gesdoto;': '\u2a82',
  795. 'gesdotol;': '\u2a84',
  796. 'gesl;': '\u22db\ufe00',
  797. 'gesles;': '\u2a94',
  798. 'Gfr;': '\U0001d50a',
  799. 'gfr;': '\U0001d524',
  800. 'Gg;': '\u22d9',
  801. 'gg;': '\u226b',
  802. 'ggg;': '\u22d9',
  803. 'gimel;': '\u2137',
  804. 'GJcy;': '\u0403',
  805. 'gjcy;': '\u0453',
  806. 'gl;': '\u2277',
  807. 'gla;': '\u2aa5',
  808. 'glE;': '\u2a92',
  809. 'glj;': '\u2aa4',
  810. 'gnap;': '\u2a8a',
  811. 'gnapprox;': '\u2a8a',
  812. 'gnE;': '\u2269',
  813. 'gne;': '\u2a88',
  814. 'gneq;': '\u2a88',
  815. 'gneqq;': '\u2269',
  816. 'gnsim;': '\u22e7',
  817. 'Gopf;': '\U0001d53e',
  818. 'gopf;': '\U0001d558',
  819. 'grave;': '`',
  820. 'GreaterEqual;': '\u2265',
  821. 'GreaterEqualLess;': '\u22db',
  822. 'GreaterFullEqual;': '\u2267',
  823. 'GreaterGreater;': '\u2aa2',
  824. 'GreaterLess;': '\u2277',
  825. 'GreaterSlantEqual;': '\u2a7e',
  826. 'GreaterTilde;': '\u2273',
  827. 'Gscr;': '\U0001d4a2',
  828. 'gscr;': '\u210a',
  829. 'gsim;': '\u2273',
  830. 'gsime;': '\u2a8e',
  831. 'gsiml;': '\u2a90',
  832. 'GT': '>',
  833. 'gt': '>',
  834. 'GT;': '>',
  835. 'Gt;': '\u226b',
  836. 'gt;': '>',
  837. 'gtcc;': '\u2aa7',
  838. 'gtcir;': '\u2a7a',
  839. 'gtdot;': '\u22d7',
  840. 'gtlPar;': '\u2995',
  841. 'gtquest;': '\u2a7c',
  842. 'gtrapprox;': '\u2a86',
  843. 'gtrarr;': '\u2978',
  844. 'gtrdot;': '\u22d7',
  845. 'gtreqless;': '\u22db',
  846. 'gtreqqless;': '\u2a8c',
  847. 'gtrless;': '\u2277',
  848. 'gtrsim;': '\u2273',
  849. 'gvertneqq;': '\u2269\ufe00',
  850. 'gvnE;': '\u2269\ufe00',
  851. 'Hacek;': '\u02c7',
  852. 'hairsp;': '\u200a',
  853. 'half;': '\xbd',
  854. 'hamilt;': '\u210b',
  855. 'HARDcy;': '\u042a',
  856. 'hardcy;': '\u044a',
  857. 'hArr;': '\u21d4',
  858. 'harr;': '\u2194',
  859. 'harrcir;': '\u2948',
  860. 'harrw;': '\u21ad',
  861. 'Hat;': '^',
  862. 'hbar;': '\u210f',
  863. 'Hcirc;': '\u0124',
  864. 'hcirc;': '\u0125',
  865. 'hearts;': '\u2665',
  866. 'heartsuit;': '\u2665',
  867. 'hellip;': '\u2026',
  868. 'hercon;': '\u22b9',
  869. 'Hfr;': '\u210c',
  870. 'hfr;': '\U0001d525',
  871. 'HilbertSpace;': '\u210b',
  872. 'hksearow;': '\u2925',
  873. 'hkswarow;': '\u2926',
  874. 'hoarr;': '\u21ff',
  875. 'homtht;': '\u223b',
  876. 'hookleftarrow;': '\u21a9',
  877. 'hookrightarrow;': '\u21aa',
  878. 'Hopf;': '\u210d',
  879. 'hopf;': '\U0001d559',
  880. 'horbar;': '\u2015',
  881. 'HorizontalLine;': '\u2500',
  882. 'Hscr;': '\u210b',
  883. 'hscr;': '\U0001d4bd',
  884. 'hslash;': '\u210f',
  885. 'Hstrok;': '\u0126',
  886. 'hstrok;': '\u0127',
  887. 'HumpDownHump;': '\u224e',
  888. 'HumpEqual;': '\u224f',
  889. 'hybull;': '\u2043',
  890. 'hyphen;': '\u2010',
  891. 'Iacute': '\xcd',
  892. 'iacute': '\xed',
  893. 'Iacute;': '\xcd',
  894. 'iacute;': '\xed',
  895. 'ic;': '\u2063',
  896. 'Icirc': '\xce',
  897. 'icirc': '\xee',
  898. 'Icirc;': '\xce',
  899. 'icirc;': '\xee',
  900. 'Icy;': '\u0418',
  901. 'icy;': '\u0438',
  902. 'Idot;': '\u0130',
  903. 'IEcy;': '\u0415',
  904. 'iecy;': '\u0435',
  905. 'iexcl': '\xa1',
  906. 'iexcl;': '\xa1',
  907. 'iff;': '\u21d4',
  908. 'Ifr;': '\u2111',
  909. 'ifr;': '\U0001d526',
  910. 'Igrave': '\xcc',
  911. 'igrave': '\xec',
  912. 'Igrave;': '\xcc',
  913. 'igrave;': '\xec',
  914. 'ii;': '\u2148',
  915. 'iiiint;': '\u2a0c',
  916. 'iiint;': '\u222d',
  917. 'iinfin;': '\u29dc',
  918. 'iiota;': '\u2129',
  919. 'IJlig;': '\u0132',
  920. 'ijlig;': '\u0133',
  921. 'Im;': '\u2111',
  922. 'Imacr;': '\u012a',
  923. 'imacr;': '\u012b',
  924. 'image;': '\u2111',
  925. 'ImaginaryI;': '\u2148',
  926. 'imagline;': '\u2110',
  927. 'imagpart;': '\u2111',
  928. 'imath;': '\u0131',
  929. 'imof;': '\u22b7',
  930. 'imped;': '\u01b5',
  931. 'Implies;': '\u21d2',
  932. 'in;': '\u2208',
  933. 'incare;': '\u2105',
  934. 'infin;': '\u221e',
  935. 'infintie;': '\u29dd',
  936. 'inodot;': '\u0131',
  937. 'Int;': '\u222c',
  938. 'int;': '\u222b',
  939. 'intcal;': '\u22ba',
  940. 'integers;': '\u2124',
  941. 'Integral;': '\u222b',
  942. 'intercal;': '\u22ba',
  943. 'Intersection;': '\u22c2',
  944. 'intlarhk;': '\u2a17',
  945. 'intprod;': '\u2a3c',
  946. 'InvisibleComma;': '\u2063',
  947. 'InvisibleTimes;': '\u2062',
  948. 'IOcy;': '\u0401',
  949. 'iocy;': '\u0451',
  950. 'Iogon;': '\u012e',
  951. 'iogon;': '\u012f',
  952. 'Iopf;': '\U0001d540',
  953. 'iopf;': '\U0001d55a',
  954. 'Iota;': '\u0399',
  955. 'iota;': '\u03b9',
  956. 'iprod;': '\u2a3c',
  957. 'iquest': '\xbf',
  958. 'iquest;': '\xbf',
  959. 'Iscr;': '\u2110',
  960. 'iscr;': '\U0001d4be',
  961. 'isin;': '\u2208',
  962. 'isindot;': '\u22f5',
  963. 'isinE;': '\u22f9',
  964. 'isins;': '\u22f4',
  965. 'isinsv;': '\u22f3',
  966. 'isinv;': '\u2208',
  967. 'it;': '\u2062',
  968. 'Itilde;': '\u0128',
  969. 'itilde;': '\u0129',
  970. 'Iukcy;': '\u0406',
  971. 'iukcy;': '\u0456',
  972. 'Iuml': '\xcf',
  973. 'iuml': '\xef',
  974. 'Iuml;': '\xcf',
  975. 'iuml;': '\xef',
  976. 'Jcirc;': '\u0134',
  977. 'jcirc;': '\u0135',
  978. 'Jcy;': '\u0419',
  979. 'jcy;': '\u0439',
  980. 'Jfr;': '\U0001d50d',
  981. 'jfr;': '\U0001d527',
  982. 'jmath;': '\u0237',
  983. 'Jopf;': '\U0001d541',
  984. 'jopf;': '\U0001d55b',
  985. 'Jscr;': '\U0001d4a5',
  986. 'jscr;': '\U0001d4bf',
  987. 'Jsercy;': '\u0408',
  988. 'jsercy;': '\u0458',
  989. 'Jukcy;': '\u0404',
  990. 'jukcy;': '\u0454',
  991. 'Kappa;': '\u039a',
  992. 'kappa;': '\u03ba',
  993. 'kappav;': '\u03f0',
  994. 'Kcedil;': '\u0136',
  995. 'kcedil;': '\u0137',
  996. 'Kcy;': '\u041a',
  997. 'kcy;': '\u043a',
  998. 'Kfr;': '\U0001d50e',
  999. 'kfr;': '\U0001d528',
  1000. 'kgreen;': '\u0138',
  1001. 'KHcy;': '\u0425',
  1002. 'khcy;': '\u0445',
  1003. 'KJcy;': '\u040c',
  1004. 'kjcy;': '\u045c',
  1005. 'Kopf;': '\U0001d542',
  1006. 'kopf;': '\U0001d55c',
  1007. 'Kscr;': '\U0001d4a6',
  1008. 'kscr;': '\U0001d4c0',
  1009. 'lAarr;': '\u21da',
  1010. 'Lacute;': '\u0139',
  1011. 'lacute;': '\u013a',
  1012. 'laemptyv;': '\u29b4',
  1013. 'lagran;': '\u2112',
  1014. 'Lambda;': '\u039b',
  1015. 'lambda;': '\u03bb',
  1016. 'Lang;': '\u27ea',
  1017. 'lang;': '\u27e8',
  1018. 'langd;': '\u2991',
  1019. 'langle;': '\u27e8',
  1020. 'lap;': '\u2a85',
  1021. 'Laplacetrf;': '\u2112',
  1022. 'laquo': '\xab',
  1023. 'laquo;': '\xab',
  1024. 'Larr;': '\u219e',
  1025. 'lArr;': '\u21d0',
  1026. 'larr;': '\u2190',
  1027. 'larrb;': '\u21e4',
  1028. 'larrbfs;': '\u291f',
  1029. 'larrfs;': '\u291d',
  1030. 'larrhk;': '\u21a9',
  1031. 'larrlp;': '\u21ab',
  1032. 'larrpl;': '\u2939',
  1033. 'larrsim;': '\u2973',
  1034. 'larrtl;': '\u21a2',
  1035. 'lat;': '\u2aab',
  1036. 'lAtail;': '\u291b',
  1037. 'latail;': '\u2919',
  1038. 'late;': '\u2aad',
  1039. 'lates;': '\u2aad\ufe00',
  1040. 'lBarr;': '\u290e',
  1041. 'lbarr;': '\u290c',
  1042. 'lbbrk;': '\u2772',
  1043. 'lbrace;': '{',
  1044. 'lbrack;': '[',
  1045. 'lbrke;': '\u298b',
  1046. 'lbrksld;': '\u298f',
  1047. 'lbrkslu;': '\u298d',
  1048. 'Lcaron;': '\u013d',
  1049. 'lcaron;': '\u013e',
  1050. 'Lcedil;': '\u013b',
  1051. 'lcedil;': '\u013c',
  1052. 'lceil;': '\u2308',
  1053. 'lcub;': '{',
  1054. 'Lcy;': '\u041b',
  1055. 'lcy;': '\u043b',
  1056. 'ldca;': '\u2936',
  1057. 'ldquo;': '\u201c',
  1058. 'ldquor;': '\u201e',
  1059. 'ldrdhar;': '\u2967',
  1060. 'ldrushar;': '\u294b',
  1061. 'ldsh;': '\u21b2',
  1062. 'lE;': '\u2266',
  1063. 'le;': '\u2264',
  1064. 'LeftAngleBracket;': '\u27e8',
  1065. 'LeftArrow;': '\u2190',
  1066. 'Leftarrow;': '\u21d0',
  1067. 'leftarrow;': '\u2190',
  1068. 'LeftArrowBar;': '\u21e4',
  1069. 'LeftArrowRightArrow;': '\u21c6',
  1070. 'leftarrowtail;': '\u21a2',
  1071. 'LeftCeiling;': '\u2308',
  1072. 'LeftDoubleBracket;': '\u27e6',
  1073. 'LeftDownTeeVector;': '\u2961',
  1074. 'LeftDownVector;': '\u21c3',
  1075. 'LeftDownVectorBar;': '\u2959',
  1076. 'LeftFloor;': '\u230a',
  1077. 'leftharpoondown;': '\u21bd',
  1078. 'leftharpoonup;': '\u21bc',
  1079. 'leftleftarrows;': '\u21c7',
  1080. 'LeftRightArrow;': '\u2194',
  1081. 'Leftrightarrow;': '\u21d4',
  1082. 'leftrightarrow;': '\u2194',
  1083. 'leftrightarrows;': '\u21c6',
  1084. 'leftrightharpoons;': '\u21cb',
  1085. 'leftrightsquigarrow;': '\u21ad',
  1086. 'LeftRightVector;': '\u294e',
  1087. 'LeftTee;': '\u22a3',
  1088. 'LeftTeeArrow;': '\u21a4',
  1089. 'LeftTeeVector;': '\u295a',
  1090. 'leftthreetimes;': '\u22cb',
  1091. 'LeftTriangle;': '\u22b2',
  1092. 'LeftTriangleBar;': '\u29cf',
  1093. 'LeftTriangleEqual;': '\u22b4',
  1094. 'LeftUpDownVector;': '\u2951',
  1095. 'LeftUpTeeVector;': '\u2960',
  1096. 'LeftUpVector;': '\u21bf',
  1097. 'LeftUpVectorBar;': '\u2958',
  1098. 'LeftVector;': '\u21bc',
  1099. 'LeftVectorBar;': '\u2952',
  1100. 'lEg;': '\u2a8b',
  1101. 'leg;': '\u22da',
  1102. 'leq;': '\u2264',
  1103. 'leqq;': '\u2266',
  1104. 'leqslant;': '\u2a7d',
  1105. 'les;': '\u2a7d',
  1106. 'lescc;': '\u2aa8',
  1107. 'lesdot;': '\u2a7f',
  1108. 'lesdoto;': '\u2a81',
  1109. 'lesdotor;': '\u2a83',
  1110. 'lesg;': '\u22da\ufe00',
  1111. 'lesges;': '\u2a93',
  1112. 'lessapprox;': '\u2a85',
  1113. 'lessdot;': '\u22d6',
  1114. 'lesseqgtr;': '\u22da',
  1115. 'lesseqqgtr;': '\u2a8b',
  1116. 'LessEqualGreater;': '\u22da',
  1117. 'LessFullEqual;': '\u2266',
  1118. 'LessGreater;': '\u2276',
  1119. 'lessgtr;': '\u2276',
  1120. 'LessLess;': '\u2aa1',
  1121. 'lesssim;': '\u2272',
  1122. 'LessSlantEqual;': '\u2a7d',
  1123. 'LessTilde;': '\u2272',
  1124. 'lfisht;': '\u297c',
  1125. 'lfloor;': '\u230a',
  1126. 'Lfr;': '\U0001d50f',
  1127. 'lfr;': '\U0001d529',
  1128. 'lg;': '\u2276',
  1129. 'lgE;': '\u2a91',
  1130. 'lHar;': '\u2962',
  1131. 'lhard;': '\u21bd',
  1132. 'lharu;': '\u21bc',
  1133. 'lharul;': '\u296a',
  1134. 'lhblk;': '\u2584',
  1135. 'LJcy;': '\u0409',
  1136. 'ljcy;': '\u0459',
  1137. 'Ll;': '\u22d8',
  1138. 'll;': '\u226a',
  1139. 'llarr;': '\u21c7',
  1140. 'llcorner;': '\u231e',
  1141. 'Lleftarrow;': '\u21da',
  1142. 'llhard;': '\u296b',
  1143. 'lltri;': '\u25fa',
  1144. 'Lmidot;': '\u013f',
  1145. 'lmidot;': '\u0140',
  1146. 'lmoust;': '\u23b0',
  1147. 'lmoustache;': '\u23b0',
  1148. 'lnap;': '\u2a89',
  1149. 'lnapprox;': '\u2a89',
  1150. 'lnE;': '\u2268',
  1151. 'lne;': '\u2a87',
  1152. 'lneq;': '\u2a87',
  1153. 'lneqq;': '\u2268',
  1154. 'lnsim;': '\u22e6',
  1155. 'loang;': '\u27ec',
  1156. 'loarr;': '\u21fd',
  1157. 'lobrk;': '\u27e6',
  1158. 'LongLeftArrow;': '\u27f5',
  1159. 'Longleftarrow;': '\u27f8',
  1160. 'longleftarrow;': '\u27f5',
  1161. 'LongLeftRightArrow;': '\u27f7',
  1162. 'Longleftrightarrow;': '\u27fa',
  1163. 'longleftrightarrow;': '\u27f7',
  1164. 'longmapsto;': '\u27fc',
  1165. 'LongRightArrow;': '\u27f6',
  1166. 'Longrightarrow;': '\u27f9',
  1167. 'longrightarrow;': '\u27f6',
  1168. 'looparrowleft;': '\u21ab',
  1169. 'looparrowright;': '\u21ac',
  1170. 'lopar;': '\u2985',
  1171. 'Lopf;': '\U0001d543',
  1172. 'lopf;': '\U0001d55d',
  1173. 'loplus;': '\u2a2d',
  1174. 'lotimes;': '\u2a34',
  1175. 'lowast;': '\u2217',
  1176. 'lowbar;': '_',
  1177. 'LowerLeftArrow;': '\u2199',
  1178. 'LowerRightArrow;': '\u2198',
  1179. 'loz;': '\u25ca',
  1180. 'lozenge;': '\u25ca',
  1181. 'lozf;': '\u29eb',
  1182. 'lpar;': '(',
  1183. 'lparlt;': '\u2993',
  1184. 'lrarr;': '\u21c6',
  1185. 'lrcorner;': '\u231f',
  1186. 'lrhar;': '\u21cb',
  1187. 'lrhard;': '\u296d',
  1188. 'lrm;': '\u200e',
  1189. 'lrtri;': '\u22bf',
  1190. 'lsaquo;': '\u2039',
  1191. 'Lscr;': '\u2112',
  1192. 'lscr;': '\U0001d4c1',
  1193. 'Lsh;': '\u21b0',
  1194. 'lsh;': '\u21b0',
  1195. 'lsim;': '\u2272',
  1196. 'lsime;': '\u2a8d',
  1197. 'lsimg;': '\u2a8f',
  1198. 'lsqb;': '[',
  1199. 'lsquo;': '\u2018',
  1200. 'lsquor;': '\u201a',
  1201. 'Lstrok;': '\u0141',
  1202. 'lstrok;': '\u0142',
  1203. 'LT': '<',
  1204. 'lt': '<',
  1205. 'LT;': '<',
  1206. 'Lt;': '\u226a',
  1207. 'lt;': '<',
  1208. 'ltcc;': '\u2aa6',
  1209. 'ltcir;': '\u2a79',
  1210. 'ltdot;': '\u22d6',
  1211. 'lthree;': '\u22cb',
  1212. 'ltimes;': '\u22c9',
  1213. 'ltlarr;': '\u2976',
  1214. 'ltquest;': '\u2a7b',
  1215. 'ltri;': '\u25c3',
  1216. 'ltrie;': '\u22b4',
  1217. 'ltrif;': '\u25c2',
  1218. 'ltrPar;': '\u2996',
  1219. 'lurdshar;': '\u294a',
  1220. 'luruhar;': '\u2966',
  1221. 'lvertneqq;': '\u2268\ufe00',
  1222. 'lvnE;': '\u2268\ufe00',
  1223. 'macr': '\xaf',
  1224. 'macr;': '\xaf',
  1225. 'male;': '\u2642',
  1226. 'malt;': '\u2720',
  1227. 'maltese;': '\u2720',
  1228. 'Map;': '\u2905',
  1229. 'map;': '\u21a6',
  1230. 'mapsto;': '\u21a6',
  1231. 'mapstodown;': '\u21a7',
  1232. 'mapstoleft;': '\u21a4',
  1233. 'mapstoup;': '\u21a5',
  1234. 'marker;': '\u25ae',
  1235. 'mcomma;': '\u2a29',
  1236. 'Mcy;': '\u041c',
  1237. 'mcy;': '\u043c',
  1238. 'mdash;': '\u2014',
  1239. 'mDDot;': '\u223a',
  1240. 'measuredangle;': '\u2221',
  1241. 'MediumSpace;': '\u205f',
  1242. 'Mellintrf;': '\u2133',
  1243. 'Mfr;': '\U0001d510',
  1244. 'mfr;': '\U0001d52a',
  1245. 'mho;': '\u2127',
  1246. 'micro': '\xb5',
  1247. 'micro;': '\xb5',
  1248. 'mid;': '\u2223',
  1249. 'midast;': '*',
  1250. 'midcir;': '\u2af0',
  1251. 'middot': '\xb7',
  1252. 'middot;': '\xb7',
  1253. 'minus;': '\u2212',
  1254. 'minusb;': '\u229f',
  1255. 'minusd;': '\u2238',
  1256. 'minusdu;': '\u2a2a',
  1257. 'MinusPlus;': '\u2213',
  1258. 'mlcp;': '\u2adb',
  1259. 'mldr;': '\u2026',
  1260. 'mnplus;': '\u2213',
  1261. 'models;': '\u22a7',
  1262. 'Mopf;': '\U0001d544',
  1263. 'mopf;': '\U0001d55e',
  1264. 'mp;': '\u2213',
  1265. 'Mscr;': '\u2133',
  1266. 'mscr;': '\U0001d4c2',
  1267. 'mstpos;': '\u223e',
  1268. 'Mu;': '\u039c',
  1269. 'mu;': '\u03bc',
  1270. 'multimap;': '\u22b8',
  1271. 'mumap;': '\u22b8',
  1272. 'nabla;': '\u2207',
  1273. 'Nacute;': '\u0143',
  1274. 'nacute;': '\u0144',
  1275. 'nang;': '\u2220\u20d2',
  1276. 'nap;': '\u2249',
  1277. 'napE;': '\u2a70\u0338',
  1278. 'napid;': '\u224b\u0338',
  1279. 'napos;': '\u0149',
  1280. 'napprox;': '\u2249',
  1281. 'natur;': '\u266e',
  1282. 'natural;': '\u266e',
  1283. 'naturals;': '\u2115',
  1284. 'nbsp': '\xa0',
  1285. 'nbsp;': '\xa0',
  1286. 'nbump;': '\u224e\u0338',
  1287. 'nbumpe;': '\u224f\u0338',
  1288. 'ncap;': '\u2a43',
  1289. 'Ncaron;': '\u0147',
  1290. 'ncaron;': '\u0148',
  1291. 'Ncedil;': '\u0145',
  1292. 'ncedil;': '\u0146',
  1293. 'ncong;': '\u2247',
  1294. 'ncongdot;': '\u2a6d\u0338',
  1295. 'ncup;': '\u2a42',
  1296. 'Ncy;': '\u041d',
  1297. 'ncy;': '\u043d',
  1298. 'ndash;': '\u2013',
  1299. 'ne;': '\u2260',
  1300. 'nearhk;': '\u2924',
  1301. 'neArr;': '\u21d7',
  1302. 'nearr;': '\u2197',
  1303. 'nearrow;': '\u2197',
  1304. 'nedot;': '\u2250\u0338',
  1305. 'NegativeMediumSpace;': '\u200b',
  1306. 'NegativeThickSpace;': '\u200b',
  1307. 'NegativeThinSpace;': '\u200b',
  1308. 'NegativeVeryThinSpace;': '\u200b',
  1309. 'nequiv;': '\u2262',
  1310. 'nesear;': '\u2928',
  1311. 'nesim;': '\u2242\u0338',
  1312. 'NestedGreaterGreater;': '\u226b',
  1313. 'NestedLessLess;': '\u226a',
  1314. 'NewLine;': '\n',
  1315. 'nexist;': '\u2204',
  1316. 'nexists;': '\u2204',
  1317. 'Nfr;': '\U0001d511',
  1318. 'nfr;': '\U0001d52b',
  1319. 'ngE;': '\u2267\u0338',
  1320. 'nge;': '\u2271',
  1321. 'ngeq;': '\u2271',
  1322. 'ngeqq;': '\u2267\u0338',
  1323. 'ngeqslant;': '\u2a7e\u0338',
  1324. 'nges;': '\u2a7e\u0338',
  1325. 'nGg;': '\u22d9\u0338',
  1326. 'ngsim;': '\u2275',
  1327. 'nGt;': '\u226b\u20d2',
  1328. 'ngt;': '\u226f',
  1329. 'ngtr;': '\u226f',
  1330. 'nGtv;': '\u226b\u0338',
  1331. 'nhArr;': '\u21ce',
  1332. 'nharr;': '\u21ae',
  1333. 'nhpar;': '\u2af2',
  1334. 'ni;': '\u220b',
  1335. 'nis;': '\u22fc',
  1336. 'nisd;': '\u22fa',
  1337. 'niv;': '\u220b',
  1338. 'NJcy;': '\u040a',
  1339. 'njcy;': '\u045a',
  1340. 'nlArr;': '\u21cd',
  1341. 'nlarr;': '\u219a',
  1342. 'nldr;': '\u2025',
  1343. 'nlE;': '\u2266\u0338',
  1344. 'nle;': '\u2270',
  1345. 'nLeftarrow;': '\u21cd',
  1346. 'nleftarrow;': '\u219a',
  1347. 'nLeftrightarrow;': '\u21ce',
  1348. 'nleftrightarrow;': '\u21ae',
  1349. 'nleq;': '\u2270',
  1350. 'nleqq;': '\u2266\u0338',
  1351. 'nleqslant;': '\u2a7d\u0338',
  1352. 'nles;': '\u2a7d\u0338',
  1353. 'nless;': '\u226e',
  1354. 'nLl;': '\u22d8\u0338',
  1355. 'nlsim;': '\u2274',
  1356. 'nLt;': '\u226a\u20d2',
  1357. 'nlt;': '\u226e',
  1358. 'nltri;': '\u22ea',
  1359. 'nltrie;': '\u22ec',
  1360. 'nLtv;': '\u226a\u0338',
  1361. 'nmid;': '\u2224',
  1362. 'NoBreak;': '\u2060',
  1363. 'NonBreakingSpace;': '\xa0',
  1364. 'Nopf;': '\u2115',
  1365. 'nopf;': '\U0001d55f',
  1366. 'not': '\xac',
  1367. 'Not;': '\u2aec',
  1368. 'not;': '\xac',
  1369. 'NotCongruent;': '\u2262',
  1370. 'NotCupCap;': '\u226d',
  1371. 'NotDoubleVerticalBar;': '\u2226',
  1372. 'NotElement;': '\u2209',
  1373. 'NotEqual;': '\u2260',
  1374. 'NotEqualTilde;': '\u2242\u0338',
  1375. 'NotExists;': '\u2204',
  1376. 'NotGreater;': '\u226f',
  1377. 'NotGreaterEqual;': '\u2271',
  1378. 'NotGreaterFullEqual;': '\u2267\u0338',
  1379. 'NotGreaterGreater;': '\u226b\u0338',
  1380. 'NotGreaterLess;': '\u2279',
  1381. 'NotGreaterSlantEqual;': '\u2a7e\u0338',
  1382. 'NotGreaterTilde;': '\u2275',
  1383. 'NotHumpDownHump;': '\u224e\u0338',
  1384. 'NotHumpEqual;': '\u224f\u0338',
  1385. 'notin;': '\u2209',
  1386. 'notindot;': '\u22f5\u0338',
  1387. 'notinE;': '\u22f9\u0338',
  1388. 'notinva;': '\u2209',
  1389. 'notinvb;': '\u22f7',
  1390. 'notinvc;': '\u22f6',
  1391. 'NotLeftTriangle;': '\u22ea',
  1392. 'NotLeftTriangleBar;': '\u29cf\u0338',
  1393. 'NotLeftTriangleEqual;': '\u22ec',
  1394. 'NotLess;': '\u226e',
  1395. 'NotLessEqual;': '\u2270',
  1396. 'NotLessGreater;': '\u2278',
  1397. 'NotLessLess;': '\u226a\u0338',
  1398. 'NotLessSlantEqual;': '\u2a7d\u0338',
  1399. 'NotLessTilde;': '\u2274',
  1400. 'NotNestedGreaterGreater;': '\u2aa2\u0338',
  1401. 'NotNestedLessLess;': '\u2aa1\u0338',
  1402. 'notni;': '\u220c',
  1403. 'notniva;': '\u220c',
  1404. 'notnivb;': '\u22fe',
  1405. 'notnivc;': '\u22fd',
  1406. 'NotPrecedes;': '\u2280',
  1407. 'NotPrecedesEqual;': '\u2aaf\u0338',
  1408. 'NotPrecedesSlantEqual;': '\u22e0',
  1409. 'NotReverseElement;': '\u220c',
  1410. 'NotRightTriangle;': '\u22eb',
  1411. 'NotRightTriangleBar;': '\u29d0\u0338',
  1412. 'NotRightTriangleEqual;': '\u22ed',
  1413. 'NotSquareSubset;': '\u228f\u0338',
  1414. 'NotSquareSubsetEqual;': '\u22e2',
  1415. 'NotSquareSuperset;': '\u2290\u0338',
  1416. 'NotSquareSupersetEqual;': '\u22e3',
  1417. 'NotSubset;': '\u2282\u20d2',
  1418. 'NotSubsetEqual;': '\u2288',
  1419. 'NotSucceeds;': '\u2281',
  1420. 'NotSucceedsEqual;': '\u2ab0\u0338',
  1421. 'NotSucceedsSlantEqual;': '\u22e1',
  1422. 'NotSucceedsTilde;': '\u227f\u0338',
  1423. 'NotSuperset;': '\u2283\u20d2',
  1424. 'NotSupersetEqual;': '\u2289',
  1425. 'NotTilde;': '\u2241',
  1426. 'NotTildeEqual;': '\u2244',
  1427. 'NotTildeFullEqual;': '\u2247',
  1428. 'NotTildeTilde;': '\u2249',
  1429. 'NotVerticalBar;': '\u2224',
  1430. 'npar;': '\u2226',
  1431. 'nparallel;': '\u2226',
  1432. 'nparsl;': '\u2afd\u20e5',
  1433. 'npart;': '\u2202\u0338',
  1434. 'npolint;': '\u2a14',
  1435. 'npr;': '\u2280',
  1436. 'nprcue;': '\u22e0',
  1437. 'npre;': '\u2aaf\u0338',
  1438. 'nprec;': '\u2280',
  1439. 'npreceq;': '\u2aaf\u0338',
  1440. 'nrArr;': '\u21cf',
  1441. 'nrarr;': '\u219b',
  1442. 'nrarrc;': '\u2933\u0338',
  1443. 'nrarrw;': '\u219d\u0338',
  1444. 'nRightarrow;': '\u21cf',
  1445. 'nrightarrow;': '\u219b',
  1446. 'nrtri;': '\u22eb',
  1447. 'nrtrie;': '\u22ed',
  1448. 'nsc;': '\u2281',
  1449. 'nsccue;': '\u22e1',
  1450. 'nsce;': '\u2ab0\u0338',
  1451. 'Nscr;': '\U0001d4a9',
  1452. 'nscr;': '\U0001d4c3',
  1453. 'nshortmid;': '\u2224',
  1454. 'nshortparallel;': '\u2226',
  1455. 'nsim;': '\u2241',
  1456. 'nsime;': '\u2244',
  1457. 'nsimeq;': '\u2244',
  1458. 'nsmid;': '\u2224',
  1459. 'nspar;': '\u2226',
  1460. 'nsqsube;': '\u22e2',
  1461. 'nsqsupe;': '\u22e3',
  1462. 'nsub;': '\u2284',
  1463. 'nsubE;': '\u2ac5\u0338',
  1464. 'nsube;': '\u2288',
  1465. 'nsubset;': '\u2282\u20d2',
  1466. 'nsubseteq;': '\u2288',
  1467. 'nsubseteqq;': '\u2ac5\u0338',
  1468. 'nsucc;': '\u2281',
  1469. 'nsucceq;': '\u2ab0\u0338',
  1470. 'nsup;': '\u2285',
  1471. 'nsupE;': '\u2ac6\u0338',
  1472. 'nsupe;': '\u2289',
  1473. 'nsupset;': '\u2283\u20d2',
  1474. 'nsupseteq;': '\u2289',
  1475. 'nsupseteqq;': '\u2ac6\u0338',
  1476. 'ntgl;': '\u2279',
  1477. 'Ntilde': '\xd1',
  1478. 'ntilde': '\xf1',
  1479. 'Ntilde;': '\xd1',
  1480. 'ntilde;': '\xf1',
  1481. 'ntlg;': '\u2278',
  1482. 'ntriangleleft;': '\u22ea',
  1483. 'ntrianglelefteq;': '\u22ec',
  1484. 'ntriangleright;': '\u22eb',
  1485. 'ntrianglerighteq;': '\u22ed',
  1486. 'Nu;': '\u039d',
  1487. 'nu;': '\u03bd',
  1488. 'num;': '#',
  1489. 'numero;': '\u2116',
  1490. 'numsp;': '\u2007',
  1491. 'nvap;': '\u224d\u20d2',
  1492. 'nVDash;': '\u22af',
  1493. 'nVdash;': '\u22ae',
  1494. 'nvDash;': '\u22ad',
  1495. 'nvdash;': '\u22ac',
  1496. 'nvge;': '\u2265\u20d2',
  1497. 'nvgt;': '>\u20d2',
  1498. 'nvHarr;': '\u2904',
  1499. 'nvinfin;': '\u29de',
  1500. 'nvlArr;': '\u2902',
  1501. 'nvle;': '\u2264\u20d2',
  1502. 'nvlt;': '<\u20d2',
  1503. 'nvltrie;': '\u22b4\u20d2',
  1504. 'nvrArr;': '\u2903',
  1505. 'nvrtrie;': '\u22b5\u20d2',
  1506. 'nvsim;': '\u223c\u20d2',
  1507. 'nwarhk;': '\u2923',
  1508. 'nwArr;': '\u21d6',
  1509. 'nwarr;': '\u2196',
  1510. 'nwarrow;': '\u2196',
  1511. 'nwnear;': '\u2927',
  1512. 'Oacute': '\xd3',
  1513. 'oacute': '\xf3',
  1514. 'Oacute;': '\xd3',
  1515. 'oacute;': '\xf3',
  1516. 'oast;': '\u229b',
  1517. 'ocir;': '\u229a',
  1518. 'Ocirc': '\xd4',
  1519. 'ocirc': '\xf4',
  1520. 'Ocirc;': '\xd4',
  1521. 'ocirc;': '\xf4',
  1522. 'Ocy;': '\u041e',
  1523. 'ocy;': '\u043e',
  1524. 'odash;': '\u229d',
  1525. 'Odblac;': '\u0150',
  1526. 'odblac;': '\u0151',
  1527. 'odiv;': '\u2a38',
  1528. 'odot;': '\u2299',
  1529. 'odsold;': '\u29bc',
  1530. 'OElig;': '\u0152',
  1531. 'oelig;': '\u0153',
  1532. 'ofcir;': '\u29bf',
  1533. 'Ofr;': '\U0001d512',
  1534. 'ofr;': '\U0001d52c',
  1535. 'ogon;': '\u02db',
  1536. 'Ograve': '\xd2',
  1537. 'ograve': '\xf2',
  1538. 'Ograve;': '\xd2',
  1539. 'ograve;': '\xf2',
  1540. 'ogt;': '\u29c1',
  1541. 'ohbar;': '\u29b5',
  1542. 'ohm;': '\u03a9',
  1543. 'oint;': '\u222e',
  1544. 'olarr;': '\u21ba',
  1545. 'olcir;': '\u29be',
  1546. 'olcross;': '\u29bb',
  1547. 'oline;': '\u203e',
  1548. 'olt;': '\u29c0',
  1549. 'Omacr;': '\u014c',
  1550. 'omacr;': '\u014d',
  1551. 'Omega;': '\u03a9',
  1552. 'omega;': '\u03c9',
  1553. 'Omicron;': '\u039f',
  1554. 'omicron;': '\u03bf',
  1555. 'omid;': '\u29b6',
  1556. 'ominus;': '\u2296',
  1557. 'Oopf;': '\U0001d546',
  1558. 'oopf;': '\U0001d560',
  1559. 'opar;': '\u29b7',
  1560. 'OpenCurlyDoubleQuote;': '\u201c',
  1561. 'OpenCurlyQuote;': '\u2018',
  1562. 'operp;': '\u29b9',
  1563. 'oplus;': '\u2295',
  1564. 'Or;': '\u2a54',
  1565. 'or;': '\u2228',
  1566. 'orarr;': '\u21bb',
  1567. 'ord;': '\u2a5d',
  1568. 'order;': '\u2134',
  1569. 'orderof;': '\u2134',
  1570. 'ordf': '\xaa',
  1571. 'ordf;': '\xaa',
  1572. 'ordm': '\xba',
  1573. 'ordm;': '\xba',
  1574. 'origof;': '\u22b6',
  1575. 'oror;': '\u2a56',
  1576. 'orslope;': '\u2a57',
  1577. 'orv;': '\u2a5b',
  1578. 'oS;': '\u24c8',
  1579. 'Oscr;': '\U0001d4aa',
  1580. 'oscr;': '\u2134',
  1581. 'Oslash': '\xd8',
  1582. 'oslash': '\xf8',
  1583. 'Oslash;': '\xd8',
  1584. 'oslash;': '\xf8',
  1585. 'osol;': '\u2298',
  1586. 'Otilde': '\xd5',
  1587. 'otilde': '\xf5',
  1588. 'Otilde;': '\xd5',
  1589. 'otilde;': '\xf5',
  1590. 'Otimes;': '\u2a37',
  1591. 'otimes;': '\u2297',
  1592. 'otimesas;': '\u2a36',
  1593. 'Ouml': '\xd6',
  1594. 'ouml': '\xf6',
  1595. 'Ouml;': '\xd6',
  1596. 'ouml;': '\xf6',
  1597. 'ovbar;': '\u233d',
  1598. 'OverBar;': '\u203e',
  1599. 'OverBrace;': '\u23de',
  1600. 'OverBracket;': '\u23b4',
  1601. 'OverParenthesis;': '\u23dc',
  1602. 'par;': '\u2225',
  1603. 'para': '\xb6',
  1604. 'para;': '\xb6',
  1605. 'parallel;': '\u2225',
  1606. 'parsim;': '\u2af3',
  1607. 'parsl;': '\u2afd',
  1608. 'part;': '\u2202',
  1609. 'PartialD;': '\u2202',
  1610. 'Pcy;': '\u041f',
  1611. 'pcy;': '\u043f',
  1612. 'percnt;': '%',
  1613. 'period;': '.',
  1614. 'permil;': '\u2030',
  1615. 'perp;': '\u22a5',
  1616. 'pertenk;': '\u2031',
  1617. 'Pfr;': '\U0001d513',
  1618. 'pfr;': '\U0001d52d',
  1619. 'Phi;': '\u03a6',
  1620. 'phi;': '\u03c6',
  1621. 'phiv;': '\u03d5',
  1622. 'phmmat;': '\u2133',
  1623. 'phone;': '\u260e',
  1624. 'Pi;': '\u03a0',
  1625. 'pi;': '\u03c0',
  1626. 'pitchfork;': '\u22d4',
  1627. 'piv;': '\u03d6',
  1628. 'planck;': '\u210f',
  1629. 'planckh;': '\u210e',
  1630. 'plankv;': '\u210f',
  1631. 'plus;': '+',
  1632. 'plusacir;': '\u2a23',
  1633. 'plusb;': '\u229e',
  1634. 'pluscir;': '\u2a22',
  1635. 'plusdo;': '\u2214',
  1636. 'plusdu;': '\u2a25',
  1637. 'pluse;': '\u2a72',
  1638. 'PlusMinus;': '\xb1',
  1639. 'plusmn': '\xb1',
  1640. 'plusmn;': '\xb1',
  1641. 'plussim;': '\u2a26',
  1642. 'plustwo;': '\u2a27',
  1643. 'pm;': '\xb1',
  1644. 'Poincareplane;': '\u210c',
  1645. 'pointint;': '\u2a15',
  1646. 'Popf;': '\u2119',
  1647. 'popf;': '\U0001d561',
  1648. 'pound': '\xa3',
  1649. 'pound;': '\xa3',
  1650. 'Pr;': '\u2abb',
  1651. 'pr;': '\u227a',
  1652. 'prap;': '\u2ab7',
  1653. 'prcue;': '\u227c',
  1654. 'prE;': '\u2ab3',
  1655. 'pre;': '\u2aaf',
  1656. 'prec;': '\u227a',
  1657. 'precapprox;': '\u2ab7',
  1658. 'preccurlyeq;': '\u227c',
  1659. 'Precedes;': '\u227a',
  1660. 'PrecedesEqual;': '\u2aaf',
  1661. 'PrecedesSlantEqual;': '\u227c',
  1662. 'PrecedesTilde;': '\u227e',
  1663. 'preceq;': '\u2aaf',
  1664. 'precnapprox;': '\u2ab9',
  1665. 'precneqq;': '\u2ab5',
  1666. 'precnsim;': '\u22e8',
  1667. 'precsim;': '\u227e',
  1668. 'Prime;': '\u2033',
  1669. 'prime;': '\u2032',
  1670. 'primes;': '\u2119',
  1671. 'prnap;': '\u2ab9',
  1672. 'prnE;': '\u2ab5',
  1673. 'prnsim;': '\u22e8',
  1674. 'prod;': '\u220f',
  1675. 'Product;': '\u220f',
  1676. 'profalar;': '\u232e',
  1677. 'profline;': '\u2312',
  1678. 'profsurf;': '\u2313',
  1679. 'prop;': '\u221d',
  1680. 'Proportion;': '\u2237',
  1681. 'Proportional;': '\u221d',
  1682. 'propto;': '\u221d',
  1683. 'prsim;': '\u227e',
  1684. 'prurel;': '\u22b0',
  1685. 'Pscr;': '\U0001d4ab',
  1686. 'pscr;': '\U0001d4c5',
  1687. 'Psi;': '\u03a8',
  1688. 'psi;': '\u03c8',
  1689. 'puncsp;': '\u2008',
  1690. 'Qfr;': '\U0001d514',
  1691. 'qfr;': '\U0001d52e',
  1692. 'qint;': '\u2a0c',
  1693. 'Qopf;': '\u211a',
  1694. 'qopf;': '\U0001d562',
  1695. 'qprime;': '\u2057',
  1696. 'Qscr;': '\U0001d4ac',
  1697. 'qscr;': '\U0001d4c6',
  1698. 'quaternions;': '\u210d',
  1699. 'quatint;': '\u2a16',
  1700. 'quest;': '?',
  1701. 'questeq;': '\u225f',
  1702. 'QUOT': '"',
  1703. 'quot': '"',
  1704. 'QUOT;': '"',
  1705. 'quot;': '"',
  1706. 'rAarr;': '\u21db',
  1707. 'race;': '\u223d\u0331',
  1708. 'Racute;': '\u0154',
  1709. 'racute;': '\u0155',
  1710. 'radic;': '\u221a',
  1711. 'raemptyv;': '\u29b3',
  1712. 'Rang;': '\u27eb',
  1713. 'rang;': '\u27e9',
  1714. 'rangd;': '\u2992',
  1715. 'range;': '\u29a5',
  1716. 'rangle;': '\u27e9',
  1717. 'raquo': '\xbb',
  1718. 'raquo;': '\xbb',
  1719. 'Rarr;': '\u21a0',
  1720. 'rArr;': '\u21d2',
  1721. 'rarr;': '\u2192',
  1722. 'rarrap;': '\u2975',
  1723. 'rarrb;': '\u21e5',
  1724. 'rarrbfs;': '\u2920',
  1725. 'rarrc;': '\u2933',
  1726. 'rarrfs;': '\u291e',
  1727. 'rarrhk;': '\u21aa',
  1728. 'rarrlp;': '\u21ac',
  1729. 'rarrpl;': '\u2945',
  1730. 'rarrsim;': '\u2974',
  1731. 'Rarrtl;': '\u2916',
  1732. 'rarrtl;': '\u21a3',
  1733. 'rarrw;': '\u219d',
  1734. 'rAtail;': '\u291c',
  1735. 'ratail;': '\u291a',
  1736. 'ratio;': '\u2236',
  1737. 'rationals;': '\u211a',
  1738. 'RBarr;': '\u2910',
  1739. 'rBarr;': '\u290f',
  1740. 'rbarr;': '\u290d',
  1741. 'rbbrk;': '\u2773',
  1742. 'rbrace;': '}',
  1743. 'rbrack;': ']',
  1744. 'rbrke;': '\u298c',
  1745. 'rbrksld;': '\u298e',
  1746. 'rbrkslu;': '\u2990',
  1747. 'Rcaron;': '\u0158',
  1748. 'rcaron;': '\u0159',
  1749. 'Rcedil;': '\u0156',
  1750. 'rcedil;': '\u0157',
  1751. 'rceil;': '\u2309',
  1752. 'rcub;': '}',
  1753. 'Rcy;': '\u0420',
  1754. 'rcy;': '\u0440',
  1755. 'rdca;': '\u2937',
  1756. 'rdldhar;': '\u2969',
  1757. 'rdquo;': '\u201d',
  1758. 'rdquor;': '\u201d',
  1759. 'rdsh;': '\u21b3',
  1760. 'Re;': '\u211c',
  1761. 'real;': '\u211c',
  1762. 'realine;': '\u211b',
  1763. 'realpart;': '\u211c',
  1764. 'reals;': '\u211d',
  1765. 'rect;': '\u25ad',
  1766. 'REG': '\xae',
  1767. 'reg': '\xae',
  1768. 'REG;': '\xae',
  1769. 'reg;': '\xae',
  1770. 'ReverseElement;': '\u220b',
  1771. 'ReverseEquilibrium;': '\u21cb',
  1772. 'ReverseUpEquilibrium;': '\u296f',
  1773. 'rfisht;': '\u297d',
  1774. 'rfloor;': '\u230b',
  1775. 'Rfr;': '\u211c',
  1776. 'rfr;': '\U0001d52f',
  1777. 'rHar;': '\u2964',
  1778. 'rhard;': '\u21c1',
  1779. 'rharu;': '\u21c0',
  1780. 'rharul;': '\u296c',
  1781. 'Rho;': '\u03a1',
  1782. 'rho;': '\u03c1',
  1783. 'rhov;': '\u03f1',
  1784. 'RightAngleBracket;': '\u27e9',
  1785. 'RightArrow;': '\u2192',
  1786. 'Rightarrow;': '\u21d2',
  1787. 'rightarrow;': '\u2192',
  1788. 'RightArrowBar;': '\u21e5',
  1789. 'RightArrowLeftArrow;': '\u21c4',
  1790. 'rightarrowtail;': '\u21a3',
  1791. 'RightCeiling;': '\u2309',
  1792. 'RightDoubleBracket;': '\u27e7',
  1793. 'RightDownTeeVector;': '\u295d',
  1794. 'RightDownVector;': '\u21c2',
  1795. 'RightDownVectorBar;': '\u2955',
  1796. 'RightFloor;': '\u230b',
  1797. 'rightharpoondown;': '\u21c1',
  1798. 'rightharpoonup;': '\u21c0',
  1799. 'rightleftarrows;': '\u21c4',
  1800. 'rightleftharpoons;': '\u21cc',
  1801. 'rightrightarrows;': '\u21c9',
  1802. 'rightsquigarrow;': '\u219d',
  1803. 'RightTee;': '\u22a2',
  1804. 'RightTeeArrow;': '\u21a6',
  1805. 'RightTeeVector;': '\u295b',
  1806. 'rightthreetimes;': '\u22cc',
  1807. 'RightTriangle;': '\u22b3',
  1808. 'RightTriangleBar;': '\u29d0',
  1809. 'RightTriangleEqual;': '\u22b5',
  1810. 'RightUpDownVector;': '\u294f',
  1811. 'RightUpTeeVector;': '\u295c',
  1812. 'RightUpVector;': '\u21be',
  1813. 'RightUpVectorBar;': '\u2954',
  1814. 'RightVector;': '\u21c0',
  1815. 'RightVectorBar;': '\u2953',
  1816. 'ring;': '\u02da',
  1817. 'risingdotseq;': '\u2253',
  1818. 'rlarr;': '\u21c4',
  1819. 'rlhar;': '\u21cc',
  1820. 'rlm;': '\u200f',
  1821. 'rmoust;': '\u23b1',
  1822. 'rmoustache;': '\u23b1',
  1823. 'rnmid;': '\u2aee',
  1824. 'roang;': '\u27ed',
  1825. 'roarr;': '\u21fe',
  1826. 'robrk;': '\u27e7',
  1827. 'ropar;': '\u2986',
  1828. 'Ropf;': '\u211d',
  1829. 'ropf;': '\U0001d563',
  1830. 'roplus;': '\u2a2e',
  1831. 'rotimes;': '\u2a35',
  1832. 'RoundImplies;': '\u2970',
  1833. 'rpar;': ')',
  1834. 'rpargt;': '\u2994',
  1835. 'rppolint;': '\u2a12',
  1836. 'rrarr;': '\u21c9',
  1837. 'Rrightarrow;': '\u21db',
  1838. 'rsaquo;': '\u203a',
  1839. 'Rscr;': '\u211b',
  1840. 'rscr;': '\U0001d4c7',
  1841. 'Rsh;': '\u21b1',
  1842. 'rsh;': '\u21b1',
  1843. 'rsqb;': ']',
  1844. 'rsquo;': '\u2019',
  1845. 'rsquor;': '\u2019',
  1846. 'rthree;': '\u22cc',
  1847. 'rtimes;': '\u22ca',
  1848. 'rtri;': '\u25b9',
  1849. 'rtrie;': '\u22b5',
  1850. 'rtrif;': '\u25b8',
  1851. 'rtriltri;': '\u29ce',
  1852. 'RuleDelayed;': '\u29f4',
  1853. 'ruluhar;': '\u2968',
  1854. 'rx;': '\u211e',
  1855. 'Sacute;': '\u015a',
  1856. 'sacute;': '\u015b',
  1857. 'sbquo;': '\u201a',
  1858. 'Sc;': '\u2abc',
  1859. 'sc;': '\u227b',
  1860. 'scap;': '\u2ab8',
  1861. 'Scaron;': '\u0160',
  1862. 'scaron;': '\u0161',
  1863. 'sccue;': '\u227d',
  1864. 'scE;': '\u2ab4',
  1865. 'sce;': '\u2ab0',
  1866. 'Scedil;': '\u015e',
  1867. 'scedil;': '\u015f',
  1868. 'Scirc;': '\u015c',
  1869. 'scirc;': '\u015d',
  1870. 'scnap;': '\u2aba',
  1871. 'scnE;': '\u2ab6',
  1872. 'scnsim;': '\u22e9',
  1873. 'scpolint;': '\u2a13',
  1874. 'scsim;': '\u227f',
  1875. 'Scy;': '\u0421',
  1876. 'scy;': '\u0441',
  1877. 'sdot;': '\u22c5',
  1878. 'sdotb;': '\u22a1',
  1879. 'sdote;': '\u2a66',
  1880. 'searhk;': '\u2925',
  1881. 'seArr;': '\u21d8',
  1882. 'searr;': '\u2198',
  1883. 'searrow;': '\u2198',
  1884. 'sect': '\xa7',
  1885. 'sect;': '\xa7',
  1886. 'semi;': ';',
  1887. 'seswar;': '\u2929',
  1888. 'setminus;': '\u2216',
  1889. 'setmn;': '\u2216',
  1890. 'sext;': '\u2736',
  1891. 'Sfr;': '\U0001d516',
  1892. 'sfr;': '\U0001d530',
  1893. 'sfrown;': '\u2322',
  1894. 'sharp;': '\u266f',
  1895. 'SHCHcy;': '\u0429',
  1896. 'shchcy;': '\u0449',
  1897. 'SHcy;': '\u0428',
  1898. 'shcy;': '\u0448',
  1899. 'ShortDownArrow;': '\u2193',
  1900. 'ShortLeftArrow;': '\u2190',
  1901. 'shortmid;': '\u2223',
  1902. 'shortparallel;': '\u2225',
  1903. 'ShortRightArrow;': '\u2192',
  1904. 'ShortUpArrow;': '\u2191',
  1905. 'shy': '\xad',
  1906. 'shy;': '\xad',
  1907. 'Sigma;': '\u03a3',
  1908. 'sigma;': '\u03c3',
  1909. 'sigmaf;': '\u03c2',
  1910. 'sigmav;': '\u03c2',
  1911. 'sim;': '\u223c',
  1912. 'simdot;': '\u2a6a',
  1913. 'sime;': '\u2243',
  1914. 'simeq;': '\u2243',
  1915. 'simg;': '\u2a9e',
  1916. 'simgE;': '\u2aa0',
  1917. 'siml;': '\u2a9d',
  1918. 'simlE;': '\u2a9f',
  1919. 'simne;': '\u2246',
  1920. 'simplus;': '\u2a24',
  1921. 'simrarr;': '\u2972',
  1922. 'slarr;': '\u2190',
  1923. 'SmallCircle;': '\u2218',
  1924. 'smallsetminus;': '\u2216',
  1925. 'smashp;': '\u2a33',
  1926. 'smeparsl;': '\u29e4',
  1927. 'smid;': '\u2223',
  1928. 'smile;': '\u2323',
  1929. 'smt;': '\u2aaa',
  1930. 'smte;': '\u2aac',
  1931. 'smtes;': '\u2aac\ufe00',
  1932. 'SOFTcy;': '\u042c',
  1933. 'softcy;': '\u044c',
  1934. 'sol;': '/',
  1935. 'solb;': '\u29c4',
  1936. 'solbar;': '\u233f',
  1937. 'Sopf;': '\U0001d54a',
  1938. 'sopf;': '\U0001d564',
  1939. 'spades;': '\u2660',
  1940. 'spadesuit;': '\u2660',
  1941. 'spar;': '\u2225',
  1942. 'sqcap;': '\u2293',
  1943. 'sqcaps;': '\u2293\ufe00',
  1944. 'sqcup;': '\u2294',
  1945. 'sqcups;': '\u2294\ufe00',
  1946. 'Sqrt;': '\u221a',
  1947. 'sqsub;': '\u228f',
  1948. 'sqsube;': '\u2291',
  1949. 'sqsubset;': '\u228f',
  1950. 'sqsubseteq;': '\u2291',
  1951. 'sqsup;': '\u2290',
  1952. 'sqsupe;': '\u2292',
  1953. 'sqsupset;': '\u2290',
  1954. 'sqsupseteq;': '\u2292',
  1955. 'squ;': '\u25a1',
  1956. 'Square;': '\u25a1',
  1957. 'square;': '\u25a1',
  1958. 'SquareIntersection;': '\u2293',
  1959. 'SquareSubset;': '\u228f',
  1960. 'SquareSubsetEqual;': '\u2291',
  1961. 'SquareSuperset;': '\u2290',
  1962. 'SquareSupersetEqual;': '\u2292',
  1963. 'SquareUnion;': '\u2294',
  1964. 'squarf;': '\u25aa',
  1965. 'squf;': '\u25aa',
  1966. 'srarr;': '\u2192',
  1967. 'Sscr;': '\U0001d4ae',
  1968. 'sscr;': '\U0001d4c8',
  1969. 'ssetmn;': '\u2216',
  1970. 'ssmile;': '\u2323',
  1971. 'sstarf;': '\u22c6',
  1972. 'Star;': '\u22c6',
  1973. 'star;': '\u2606',
  1974. 'starf;': '\u2605',
  1975. 'straightepsilon;': '\u03f5',
  1976. 'straightphi;': '\u03d5',
  1977. 'strns;': '\xaf',
  1978. 'Sub;': '\u22d0',
  1979. 'sub;': '\u2282',
  1980. 'subdot;': '\u2abd',
  1981. 'subE;': '\u2ac5',
  1982. 'sube;': '\u2286',
  1983. 'subedot;': '\u2ac3',
  1984. 'submult;': '\u2ac1',
  1985. 'subnE;': '\u2acb',
  1986. 'subne;': '\u228a',
  1987. 'subplus;': '\u2abf',
  1988. 'subrarr;': '\u2979',
  1989. 'Subset;': '\u22d0',
  1990. 'subset;': '\u2282',
  1991. 'subseteq;': '\u2286',
  1992. 'subseteqq;': '\u2ac5',
  1993. 'SubsetEqual;': '\u2286',
  1994. 'subsetneq;': '\u228a',
  1995. 'subsetneqq;': '\u2acb',
  1996. 'subsim;': '\u2ac7',
  1997. 'subsub;': '\u2ad5',
  1998. 'subsup;': '\u2ad3',
  1999. 'succ;': '\u227b',
  2000. 'succapprox;': '\u2ab8',
  2001. 'succcurlyeq;': '\u227d',
  2002. 'Succeeds;': '\u227b',
  2003. 'SucceedsEqual;': '\u2ab0',
  2004. 'SucceedsSlantEqual;': '\u227d',
  2005. 'SucceedsTilde;': '\u227f',
  2006. 'succeq;': '\u2ab0',
  2007. 'succnapprox;': '\u2aba',
  2008. 'succneqq;': '\u2ab6',
  2009. 'succnsim;': '\u22e9',
  2010. 'succsim;': '\u227f',
  2011. 'SuchThat;': '\u220b',
  2012. 'Sum;': '\u2211',
  2013. 'sum;': '\u2211',
  2014. 'sung;': '\u266a',
  2015. 'sup1': '\xb9',
  2016. 'sup1;': '\xb9',
  2017. 'sup2': '\xb2',
  2018. 'sup2;': '\xb2',
  2019. 'sup3': '\xb3',
  2020. 'sup3;': '\xb3',
  2021. 'Sup;': '\u22d1',
  2022. 'sup;': '\u2283',
  2023. 'supdot;': '\u2abe',
  2024. 'supdsub;': '\u2ad8',
  2025. 'supE;': '\u2ac6',
  2026. 'supe;': '\u2287',
  2027. 'supedot;': '\u2ac4',
  2028. 'Superset;': '\u2283',
  2029. 'SupersetEqual;': '\u2287',
  2030. 'suphsol;': '\u27c9',
  2031. 'suphsub;': '\u2ad7',
  2032. 'suplarr;': '\u297b',
  2033. 'supmult;': '\u2ac2',
  2034. 'supnE;': '\u2acc',
  2035. 'supne;': '\u228b',
  2036. 'supplus;': '\u2ac0',
  2037. 'Supset;': '\u22d1',
  2038. 'supset;': '\u2283',
  2039. 'supseteq;': '\u2287',
  2040. 'supseteqq;': '\u2ac6',
  2041. 'supsetneq;': '\u228b',
  2042. 'supsetneqq;': '\u2acc',
  2043. 'supsim;': '\u2ac8',
  2044. 'supsub;': '\u2ad4',
  2045. 'supsup;': '\u2ad6',
  2046. 'swarhk;': '\u2926',
  2047. 'swArr;': '\u21d9',
  2048. 'swarr;': '\u2199',
  2049. 'swarrow;': '\u2199',
  2050. 'swnwar;': '\u292a',
  2051. 'szlig': '\xdf',
  2052. 'szlig;': '\xdf',
  2053. 'Tab;': '\t',
  2054. 'target;': '\u2316',
  2055. 'Tau;': '\u03a4',
  2056. 'tau;': '\u03c4',
  2057. 'tbrk;': '\u23b4',
  2058. 'Tcaron;': '\u0164',
  2059. 'tcaron;': '\u0165',
  2060. 'Tcedil;': '\u0162',
  2061. 'tcedil;': '\u0163',
  2062. 'Tcy;': '\u0422',
  2063. 'tcy;': '\u0442',
  2064. 'tdot;': '\u20db',
  2065. 'telrec;': '\u2315',
  2066. 'Tfr;': '\U0001d517',
  2067. 'tfr;': '\U0001d531',
  2068. 'there4;': '\u2234',
  2069. 'Therefore;': '\u2234',
  2070. 'therefore;': '\u2234',
  2071. 'Theta;': '\u0398',
  2072. 'theta;': '\u03b8',
  2073. 'thetasym;': '\u03d1',
  2074. 'thetav;': '\u03d1',
  2075. 'thickapprox;': '\u2248',
  2076. 'thicksim;': '\u223c',
  2077. 'ThickSpace;': '\u205f\u200a',
  2078. 'thinsp;': '\u2009',
  2079. 'ThinSpace;': '\u2009',
  2080. 'thkap;': '\u2248',
  2081. 'thksim;': '\u223c',
  2082. 'THORN': '\xde',
  2083. 'thorn': '\xfe',
  2084. 'THORN;': '\xde',
  2085. 'thorn;': '\xfe',
  2086. 'Tilde;': '\u223c',
  2087. 'tilde;': '\u02dc',
  2088. 'TildeEqual;': '\u2243',
  2089. 'TildeFullEqual;': '\u2245',
  2090. 'TildeTilde;': '\u2248',
  2091. 'times': '\xd7',
  2092. 'times;': '\xd7',
  2093. 'timesb;': '\u22a0',
  2094. 'timesbar;': '\u2a31',
  2095. 'timesd;': '\u2a30',
  2096. 'tint;': '\u222d',
  2097. 'toea;': '\u2928',
  2098. 'top;': '\u22a4',
  2099. 'topbot;': '\u2336',
  2100. 'topcir;': '\u2af1',
  2101. 'Topf;': '\U0001d54b',
  2102. 'topf;': '\U0001d565',
  2103. 'topfork;': '\u2ada',
  2104. 'tosa;': '\u2929',
  2105. 'tprime;': '\u2034',
  2106. 'TRADE;': '\u2122',
  2107. 'trade;': '\u2122',
  2108. 'triangle;': '\u25b5',
  2109. 'triangledown;': '\u25bf',
  2110. 'triangleleft;': '\u25c3',
  2111. 'trianglelefteq;': '\u22b4',
  2112. 'triangleq;': '\u225c',
  2113. 'triangleright;': '\u25b9',
  2114. 'trianglerighteq;': '\u22b5',
  2115. 'tridot;': '\u25ec',
  2116. 'trie;': '\u225c',
  2117. 'triminus;': '\u2a3a',
  2118. 'TripleDot;': '\u20db',
  2119. 'triplus;': '\u2a39',
  2120. 'trisb;': '\u29cd',
  2121. 'tritime;': '\u2a3b',
  2122. 'trpezium;': '\u23e2',
  2123. 'Tscr;': '\U0001d4af',
  2124. 'tscr;': '\U0001d4c9',
  2125. 'TScy;': '\u0426',
  2126. 'tscy;': '\u0446',
  2127. 'TSHcy;': '\u040b',
  2128. 'tshcy;': '\u045b',
  2129. 'Tstrok;': '\u0166',
  2130. 'tstrok;': '\u0167',
  2131. 'twixt;': '\u226c',
  2132. 'twoheadleftarrow;': '\u219e',
  2133. 'twoheadrightarrow;': '\u21a0',
  2134. 'Uacute': '\xda',
  2135. 'uacute': '\xfa',
  2136. 'Uacute;': '\xda',
  2137. 'uacute;': '\xfa',
  2138. 'Uarr;': '\u219f',
  2139. 'uArr;': '\u21d1',
  2140. 'uarr;': '\u2191',
  2141. 'Uarrocir;': '\u2949',
  2142. 'Ubrcy;': '\u040e',
  2143. 'ubrcy;': '\u045e',
  2144. 'Ubreve;': '\u016c',
  2145. 'ubreve;': '\u016d',
  2146. 'Ucirc': '\xdb',
  2147. 'ucirc': '\xfb',
  2148. 'Ucirc;': '\xdb',
  2149. 'ucirc;': '\xfb',
  2150. 'Ucy;': '\u0423',
  2151. 'ucy;': '\u0443',
  2152. 'udarr;': '\u21c5',
  2153. 'Udblac;': '\u0170',
  2154. 'udblac;': '\u0171',
  2155. 'udhar;': '\u296e',
  2156. 'ufisht;': '\u297e',
  2157. 'Ufr;': '\U0001d518',
  2158. 'ufr;': '\U0001d532',
  2159. 'Ugrave': '\xd9',
  2160. 'ugrave': '\xf9',
  2161. 'Ugrave;': '\xd9',
  2162. 'ugrave;': '\xf9',
  2163. 'uHar;': '\u2963',
  2164. 'uharl;': '\u21bf',
  2165. 'uharr;': '\u21be',
  2166. 'uhblk;': '\u2580',
  2167. 'ulcorn;': '\u231c',
  2168. 'ulcorner;': '\u231c',
  2169. 'ulcrop;': '\u230f',
  2170. 'ultri;': '\u25f8',
  2171. 'Umacr;': '\u016a',
  2172. 'umacr;': '\u016b',
  2173. 'uml': '\xa8',
  2174. 'uml;': '\xa8',
  2175. 'UnderBar;': '_',
  2176. 'UnderBrace;': '\u23df',
  2177. 'UnderBracket;': '\u23b5',
  2178. 'UnderParenthesis;': '\u23dd',
  2179. 'Union;': '\u22c3',
  2180. 'UnionPlus;': '\u228e',
  2181. 'Uogon;': '\u0172',
  2182. 'uogon;': '\u0173',
  2183. 'Uopf;': '\U0001d54c',
  2184. 'uopf;': '\U0001d566',
  2185. 'UpArrow;': '\u2191',
  2186. 'Uparrow;': '\u21d1',
  2187. 'uparrow;': '\u2191',
  2188. 'UpArrowBar;': '\u2912',
  2189. 'UpArrowDownArrow;': '\u21c5',
  2190. 'UpDownArrow;': '\u2195',
  2191. 'Updownarrow;': '\u21d5',
  2192. 'updownarrow;': '\u2195',
  2193. 'UpEquilibrium;': '\u296e',
  2194. 'upharpoonleft;': '\u21bf',
  2195. 'upharpoonright;': '\u21be',
  2196. 'uplus;': '\u228e',
  2197. 'UpperLeftArrow;': '\u2196',
  2198. 'UpperRightArrow;': '\u2197',
  2199. 'Upsi;': '\u03d2',
  2200. 'upsi;': '\u03c5',
  2201. 'upsih;': '\u03d2',
  2202. 'Upsilon;': '\u03a5',
  2203. 'upsilon;': '\u03c5',
  2204. 'UpTee;': '\u22a5',
  2205. 'UpTeeArrow;': '\u21a5',
  2206. 'upuparrows;': '\u21c8',
  2207. 'urcorn;': '\u231d',
  2208. 'urcorner;': '\u231d',
  2209. 'urcrop;': '\u230e',
  2210. 'Uring;': '\u016e',
  2211. 'uring;': '\u016f',
  2212. 'urtri;': '\u25f9',
  2213. 'Uscr;': '\U0001d4b0',
  2214. 'uscr;': '\U0001d4ca',
  2215. 'utdot;': '\u22f0',
  2216. 'Utilde;': '\u0168',
  2217. 'utilde;': '\u0169',
  2218. 'utri;': '\u25b5',
  2219. 'utrif;': '\u25b4',
  2220. 'uuarr;': '\u21c8',
  2221. 'Uuml': '\xdc',
  2222. 'uuml': '\xfc',
  2223. 'Uuml;': '\xdc',
  2224. 'uuml;': '\xfc',
  2225. 'uwangle;': '\u29a7',
  2226. 'vangrt;': '\u299c',
  2227. 'varepsilon;': '\u03f5',
  2228. 'varkappa;': '\u03f0',
  2229. 'varnothing;': '\u2205',
  2230. 'varphi;': '\u03d5',
  2231. 'varpi;': '\u03d6',
  2232. 'varpropto;': '\u221d',
  2233. 'vArr;': '\u21d5',
  2234. 'varr;': '\u2195',
  2235. 'varrho;': '\u03f1',
  2236. 'varsigma;': '\u03c2',
  2237. 'varsubsetneq;': '\u228a\ufe00',
  2238. 'varsubsetneqq;': '\u2acb\ufe00',
  2239. 'varsupsetneq;': '\u228b\ufe00',
  2240. 'varsupsetneqq;': '\u2acc\ufe00',
  2241. 'vartheta;': '\u03d1',
  2242. 'vartriangleleft;': '\u22b2',
  2243. 'vartriangleright;': '\u22b3',
  2244. 'Vbar;': '\u2aeb',
  2245. 'vBar;': '\u2ae8',
  2246. 'vBarv;': '\u2ae9',
  2247. 'Vcy;': '\u0412',
  2248. 'vcy;': '\u0432',
  2249. 'VDash;': '\u22ab',
  2250. 'Vdash;': '\u22a9',
  2251. 'vDash;': '\u22a8',
  2252. 'vdash;': '\u22a2',
  2253. 'Vdashl;': '\u2ae6',
  2254. 'Vee;': '\u22c1',
  2255. 'vee;': '\u2228',
  2256. 'veebar;': '\u22bb',
  2257. 'veeeq;': '\u225a',
  2258. 'vellip;': '\u22ee',
  2259. 'Verbar;': '\u2016',
  2260. 'verbar;': '|',
  2261. 'Vert;': '\u2016',
  2262. 'vert;': '|',
  2263. 'VerticalBar;': '\u2223',
  2264. 'VerticalLine;': '|',
  2265. 'VerticalSeparator;': '\u2758',
  2266. 'VerticalTilde;': '\u2240',
  2267. 'VeryThinSpace;': '\u200a',
  2268. 'Vfr;': '\U0001d519',
  2269. 'vfr;': '\U0001d533',
  2270. 'vltri;': '\u22b2',
  2271. 'vnsub;': '\u2282\u20d2',
  2272. 'vnsup;': '\u2283\u20d2',
  2273. 'Vopf;': '\U0001d54d',
  2274. 'vopf;': '\U0001d567',
  2275. 'vprop;': '\u221d',
  2276. 'vrtri;': '\u22b3',
  2277. 'Vscr;': '\U0001d4b1',
  2278. 'vscr;': '\U0001d4cb',
  2279. 'vsubnE;': '\u2acb\ufe00',
  2280. 'vsubne;': '\u228a\ufe00',
  2281. 'vsupnE;': '\u2acc\ufe00',
  2282. 'vsupne;': '\u228b\ufe00',
  2283. 'Vvdash;': '\u22aa',
  2284. 'vzigzag;': '\u299a',
  2285. 'Wcirc;': '\u0174',
  2286. 'wcirc;': '\u0175',
  2287. 'wedbar;': '\u2a5f',
  2288. 'Wedge;': '\u22c0',
  2289. 'wedge;': '\u2227',
  2290. 'wedgeq;': '\u2259',
  2291. 'weierp;': '\u2118',
  2292. 'Wfr;': '\U0001d51a',
  2293. 'wfr;': '\U0001d534',
  2294. 'Wopf;': '\U0001d54e',
  2295. 'wopf;': '\U0001d568',
  2296. 'wp;': '\u2118',
  2297. 'wr;': '\u2240',
  2298. 'wreath;': '\u2240',
  2299. 'Wscr;': '\U0001d4b2',
  2300. 'wscr;': '\U0001d4cc',
  2301. 'xcap;': '\u22c2',
  2302. 'xcirc;': '\u25ef',
  2303. 'xcup;': '\u22c3',
  2304. 'xdtri;': '\u25bd',
  2305. 'Xfr;': '\U0001d51b',
  2306. 'xfr;': '\U0001d535',
  2307. 'xhArr;': '\u27fa',
  2308. 'xharr;': '\u27f7',
  2309. 'Xi;': '\u039e',
  2310. 'xi;': '\u03be',
  2311. 'xlArr;': '\u27f8',
  2312. 'xlarr;': '\u27f5',
  2313. 'xmap;': '\u27fc',
  2314. 'xnis;': '\u22fb',
  2315. 'xodot;': '\u2a00',
  2316. 'Xopf;': '\U0001d54f',
  2317. 'xopf;': '\U0001d569',
  2318. 'xoplus;': '\u2a01',
  2319. 'xotime;': '\u2a02',
  2320. 'xrArr;': '\u27f9',
  2321. 'xrarr;': '\u27f6',
  2322. 'Xscr;': '\U0001d4b3',
  2323. 'xscr;': '\U0001d4cd',
  2324. 'xsqcup;': '\u2a06',
  2325. 'xuplus;': '\u2a04',
  2326. 'xutri;': '\u25b3',
  2327. 'xvee;': '\u22c1',
  2328. 'xwedge;': '\u22c0',
  2329. 'Yacute': '\xdd',
  2330. 'yacute': '\xfd',
  2331. 'Yacute;': '\xdd',
  2332. 'yacute;': '\xfd',
  2333. 'YAcy;': '\u042f',
  2334. 'yacy;': '\u044f',
  2335. 'Ycirc;': '\u0176',
  2336. 'ycirc;': '\u0177',
  2337. 'Ycy;': '\u042b',
  2338. 'ycy;': '\u044b',
  2339. 'yen': '\xa5',
  2340. 'yen;': '\xa5',
  2341. 'Yfr;': '\U0001d51c',
  2342. 'yfr;': '\U0001d536',
  2343. 'YIcy;': '\u0407',
  2344. 'yicy;': '\u0457',
  2345. 'Yopf;': '\U0001d550',
  2346. 'yopf;': '\U0001d56a',
  2347. 'Yscr;': '\U0001d4b4',
  2348. 'yscr;': '\U0001d4ce',
  2349. 'YUcy;': '\u042e',
  2350. 'yucy;': '\u044e',
  2351. 'yuml': '\xff',
  2352. 'Yuml;': '\u0178',
  2353. 'yuml;': '\xff',
  2354. 'Zacute;': '\u0179',
  2355. 'zacute;': '\u017a',
  2356. 'Zcaron;': '\u017d',
  2357. 'zcaron;': '\u017e',
  2358. 'Zcy;': '\u0417',
  2359. 'zcy;': '\u0437',
  2360. 'Zdot;': '\u017b',
  2361. 'zdot;': '\u017c',
  2362. 'zeetrf;': '\u2128',
  2363. 'ZeroWidthSpace;': '\u200b',
  2364. 'Zeta;': '\u0396',
  2365. 'zeta;': '\u03b6',
  2366. 'Zfr;': '\u2128',
  2367. 'zfr;': '\U0001d537',
  2368. 'ZHcy;': '\u0416',
  2369. 'zhcy;': '\u0436',
  2370. 'zigrarr;': '\u21dd',
  2371. 'Zopf;': '\u2124',
  2372. 'zopf;': '\U0001d56b',
  2373. 'Zscr;': '\U0001d4b5',
  2374. 'zscr;': '\U0001d4cf',
  2375. 'zwj;': '\u200d',
  2376. 'zwnj;': '\u200c',
  2377. }
  2378. try:
  2379. import http.client as compat_http_client
  2380. except ImportError: # Python 2
  2381. import httplib as compat_http_client
  2382. try:
  2383. compat_http_client.HTTPResponse.getcode
  2384. except AttributeError:
  2385. # Py < 3.1
  2386. compat_http_client.HTTPResponse.getcode = lambda self: self.status
  2387. try:
  2388. from urllib.error import HTTPError as compat_HTTPError
  2389. except ImportError: # Python 2
  2390. from urllib2 import HTTPError as compat_HTTPError
  2391. compat_urllib_HTTPError = compat_HTTPError
  2392. try:
  2393. from urllib.request import urlretrieve as compat_urlretrieve
  2394. except ImportError: # Python 2
  2395. from urllib import urlretrieve as compat_urlretrieve
  2396. compat_urllib_request_urlretrieve = compat_urlretrieve
  2397. try:
  2398. from html.parser import HTMLParser as compat_HTMLParser
  2399. except ImportError: # Python 2
  2400. from HTMLParser import HTMLParser as compat_HTMLParser
  2401. compat_html_parser_HTMLParser = compat_HTMLParser
  2402. try: # Python 2
  2403. from HTMLParser import HTMLParseError as compat_HTMLParseError
  2404. except ImportError: # Python <3.4
  2405. try:
  2406. from html.parser import HTMLParseError as compat_HTMLParseError
  2407. except ImportError: # Python >3.4
  2408. # HTMLParseError has been deprecated in Python 3.3 and removed in
  2409. # Python 3.5. Introducing dummy exception for Python >3.5 for compatible
  2410. # and uniform cross-version exception handling
  2411. class compat_HTMLParseError(Exception):
  2412. pass
  2413. compat_html_parser_HTMLParseError = compat_HTMLParseError
  2414. try:
  2415. from subprocess import DEVNULL
  2416. compat_subprocess_get_DEVNULL = lambda: DEVNULL
  2417. except ImportError:
  2418. compat_subprocess_get_DEVNULL = lambda: open(os.path.devnull, 'w')
  2419. try:
  2420. import http.server as compat_http_server
  2421. except ImportError:
  2422. import BaseHTTPServer as compat_http_server
  2423. try:
  2424. from urllib.parse import unquote_to_bytes as compat_urllib_parse_unquote_to_bytes
  2425. from urllib.parse import unquote as compat_urllib_parse_unquote
  2426. from urllib.parse import unquote_plus as compat_urllib_parse_unquote_plus
  2427. from urllib.parse import urlencode as compat_urllib_parse_urlencode
  2428. from urllib.parse import parse_qs as compat_parse_qs
  2429. except ImportError: # Python 2
  2430. _asciire = (compat_urllib_parse._asciire if hasattr(compat_urllib_parse, '_asciire')
  2431. else re.compile(r'([\x00-\x7f]+)'))
  2432. # HACK: The following are the correct unquote_to_bytes, unquote and unquote_plus
  2433. # implementations from cpython 3.4.3's stdlib. Python 2's version
  2434. # is apparently broken (see https://github.com/ytdl-org/youtube-dl/pull/6244)
  2435. def compat_urllib_parse_unquote_to_bytes(string):
  2436. """unquote_to_bytes('abc%20def') -> b'abc def'."""
  2437. # Note: strings are encoded as UTF-8. This is only an issue if it contains
  2438. # unescaped non-ASCII characters, which URIs should not.
  2439. if not string:
  2440. # Is it a string-like object?
  2441. string.split
  2442. return b''
  2443. if isinstance(string, compat_str):
  2444. string = string.encode('utf-8')
  2445. bits = string.split(b'%')
  2446. if len(bits) == 1:
  2447. return string
  2448. res = [bits[0]]
  2449. append = res.append
  2450. for item in bits[1:]:
  2451. try:
  2452. append(compat_urllib_parse._hextochr[item[:2]])
  2453. append(item[2:])
  2454. except KeyError:
  2455. append(b'%')
  2456. append(item)
  2457. return b''.join(res)
  2458. def compat_urllib_parse_unquote(string, encoding='utf-8', errors='replace'):
  2459. """Replace %xx escapes by their single-character equivalent. The optional
  2460. encoding and errors parameters specify how to decode percent-encoded
  2461. sequences into Unicode characters, as accepted by the bytes.decode()
  2462. method.
  2463. By default, percent-encoded sequences are decoded with UTF-8, and invalid
  2464. sequences are replaced by a placeholder character.
  2465. unquote('abc%20def') -> 'abc def'.
  2466. """
  2467. if '%' not in string:
  2468. string.split
  2469. return string
  2470. if encoding is None:
  2471. encoding = 'utf-8'
  2472. if errors is None:
  2473. errors = 'replace'
  2474. bits = _asciire.split(string)
  2475. res = [bits[0]]
  2476. append = res.append
  2477. for i in range(1, len(bits), 2):
  2478. append(compat_urllib_parse_unquote_to_bytes(bits[i]).decode(encoding, errors))
  2479. append(bits[i + 1])
  2480. return ''.join(res)
  2481. def compat_urllib_parse_unquote_plus(string, encoding='utf-8', errors='replace'):
  2482. """Like unquote(), but also replace plus signs by spaces, as required for
  2483. unquoting HTML form values.
  2484. unquote_plus('%7e/abc+def') -> '~/abc def'
  2485. """
  2486. string = string.replace('+', ' ')
  2487. return compat_urllib_parse_unquote(string, encoding, errors)
  2488. # Python 2 will choke in urlencode on mixture of byte and unicode strings.
  2489. # Possible solutions are to either port it from python 3 with all
  2490. # the friends or manually ensure input query contains only byte strings.
  2491. # We will stick with latter thus recursively encoding the whole query.
  2492. def compat_urllib_parse_urlencode(query, doseq=0, encoding='utf-8'):
  2493. def encode_elem(e):
  2494. if isinstance(e, dict):
  2495. e = encode_dict(e)
  2496. elif isinstance(e, (list, tuple,)):
  2497. list_e = encode_list(e)
  2498. e = tuple(list_e) if isinstance(e, tuple) else list_e
  2499. elif isinstance(e, compat_str):
  2500. e = e.encode(encoding)
  2501. return e
  2502. def encode_dict(d):
  2503. return dict((encode_elem(k), encode_elem(v)) for k, v in d.items())
  2504. def encode_list(l):
  2505. return [encode_elem(e) for e in l]
  2506. return compat_urllib_parse._urlencode(encode_elem(query), doseq=doseq)
  2507. # HACK: The following is the correct parse_qs implementation from cpython 3's stdlib.
  2508. # Python 2's version is apparently totally broken
  2509. def _parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
  2510. encoding='utf-8', errors='replace'):
  2511. qs, _coerce_result = qs, compat_str
  2512. pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
  2513. r = []
  2514. for name_value in pairs:
  2515. if not name_value and not strict_parsing:
  2516. continue
  2517. nv = name_value.split('=', 1)
  2518. if len(nv) != 2:
  2519. if strict_parsing:
  2520. raise ValueError('bad query field: %r' % (name_value,))
  2521. # Handle case of a control-name with no equal sign
  2522. if keep_blank_values:
  2523. nv.append('')
  2524. else:
  2525. continue
  2526. if len(nv[1]) or keep_blank_values:
  2527. name = nv[0].replace('+', ' ')
  2528. name = compat_urllib_parse_unquote(
  2529. name, encoding=encoding, errors=errors)
  2530. name = _coerce_result(name)
  2531. value = nv[1].replace('+', ' ')
  2532. value = compat_urllib_parse_unquote(
  2533. value, encoding=encoding, errors=errors)
  2534. value = _coerce_result(value)
  2535. r.append((name, value))
  2536. return r
  2537. def compat_parse_qs(qs, keep_blank_values=False, strict_parsing=False,
  2538. encoding='utf-8', errors='replace'):
  2539. parsed_result = {}
  2540. pairs = _parse_qsl(qs, keep_blank_values, strict_parsing,
  2541. encoding=encoding, errors=errors)
  2542. for name, value in pairs:
  2543. if name in parsed_result:
  2544. parsed_result[name].append(value)
  2545. else:
  2546. parsed_result[name] = [value]
  2547. return parsed_result
  2548. setattr(compat_urllib_parse, '_urlencode',
  2549. getattr(compat_urllib_parse, 'urlencode'))
  2550. for name, fix in (
  2551. ('unquote_to_bytes', compat_urllib_parse_unquote_to_bytes),
  2552. ('parse_unquote', compat_urllib_parse_unquote),
  2553. ('unquote_plus', compat_urllib_parse_unquote_plus),
  2554. ('urlencode', compat_urllib_parse_urlencode),
  2555. ('parse_qs', compat_parse_qs)):
  2556. setattr(compat_urllib_parse, name, fix)
  2557. compat_urllib_parse_parse_qs = compat_parse_qs
  2558. try:
  2559. from urllib.request import DataHandler as compat_urllib_request_DataHandler
  2560. except ImportError: # Python < 3.4
  2561. # Ported from CPython 98774:1733b3bd46db, Lib/urllib/request.py
  2562. class compat_urllib_request_DataHandler(compat_urllib_request.BaseHandler):
  2563. def data_open(self, req):
  2564. # data URLs as specified in RFC 2397.
  2565. #
  2566. # ignores POSTed data
  2567. #
  2568. # syntax:
  2569. # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  2570. # mediatype := [ type "/" subtype ] *( ";" parameter )
  2571. # data := *urlchar
  2572. # parameter := attribute "=" value
  2573. url = req.get_full_url()
  2574. scheme, data = url.split(':', 1)
  2575. mediatype, data = data.split(',', 1)
  2576. # even base64 encoded data URLs might be quoted so unquote in any case:
  2577. data = compat_urllib_parse_unquote_to_bytes(data)
  2578. if mediatype.endswith(';base64'):
  2579. data = binascii.a2b_base64(data)
  2580. mediatype = mediatype[:-7]
  2581. if not mediatype:
  2582. mediatype = 'text/plain;charset=US-ASCII'
  2583. headers = email.message_from_string(
  2584. 'Content-type: %s\nContent-length: %d\n' % (mediatype, len(data)))
  2585. return compat_urllib_response.addinfourl(io.BytesIO(data), headers, url)
  2586. try:
  2587. from xml.etree.ElementTree import ParseError as compat_xml_parse_error
  2588. except ImportError: # Python 2.6
  2589. from xml.parsers.expat import ExpatError as compat_xml_parse_error
  2590. compat_xml_etree_ElementTree_ParseError = compat_xml_parse_error
  2591. etree = xml.etree.ElementTree
  2592. class _TreeBuilder(etree.TreeBuilder):
  2593. def doctype(self, name, pubid, system):
  2594. pass
  2595. try:
  2596. # xml.etree.ElementTree.Element is a method in Python <=2.6 and
  2597. # the following will crash with:
  2598. # TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types
  2599. isinstance(None, etree.Element)
  2600. from xml.etree.ElementTree import Element as compat_etree_Element
  2601. except TypeError: # Python <=2.6
  2602. from xml.etree.ElementTree import _ElementInterface as compat_etree_Element
  2603. compat_xml_etree_ElementTree_Element = compat_etree_Element
  2604. if sys.version_info[0] >= 3:
  2605. def compat_etree_fromstring(text):
  2606. return etree.XML(text, parser=etree.XMLParser(target=_TreeBuilder()))
  2607. else:
  2608. # python 2.x tries to encode unicode strings with ascii (see the
  2609. # XMLParser._fixtext method)
  2610. try:
  2611. _etree_iter = etree.Element.iter
  2612. except AttributeError: # Python <=2.6
  2613. def _etree_iter(root):
  2614. for el in root.findall('*'):
  2615. yield el
  2616. for sub in _etree_iter(el):
  2617. yield sub
  2618. # on 2.6 XML doesn't have a parser argument, function copied from CPython
  2619. # 2.7 source
  2620. def _XML(text, parser=None):
  2621. if not parser:
  2622. parser = etree.XMLParser(target=_TreeBuilder())
  2623. parser.feed(text)
  2624. return parser.close()
  2625. def _element_factory(*args, **kwargs):
  2626. el = etree.Element(*args, **kwargs)
  2627. for k, v in el.items():
  2628. if isinstance(v, bytes):
  2629. el.set(k, v.decode('utf-8'))
  2630. return el
  2631. def compat_etree_fromstring(text):
  2632. doc = _XML(text, parser=etree.XMLParser(target=_TreeBuilder(element_factory=_element_factory)))
  2633. for el in _etree_iter(doc):
  2634. if el.text is not None and isinstance(el.text, bytes):
  2635. el.text = el.text.decode('utf-8')
  2636. return doc
  2637. if hasattr(etree, 'register_namespace'):
  2638. compat_etree_register_namespace = etree.register_namespace
  2639. else:
  2640. def compat_etree_register_namespace(prefix, uri):
  2641. """Register a namespace prefix.
  2642. The registry is global, and any existing mapping for either the
  2643. given prefix or the namespace URI will be removed.
  2644. *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and
  2645. attributes in this namespace will be serialized with prefix if possible.
  2646. ValueError is raised if prefix is reserved or is invalid.
  2647. """
  2648. if re.match(r"ns\d+$", prefix):
  2649. raise ValueError("Prefix format reserved for internal use")
  2650. for k, v in list(etree._namespace_map.items()):
  2651. if k == uri or v == prefix:
  2652. del etree._namespace_map[k]
  2653. etree._namespace_map[uri] = prefix
  2654. compat_xml_etree_register_namespace = compat_etree_register_namespace
  2655. if sys.version_info < (2, 7):
  2656. # Here comes the crazy part: In 2.6, if the xpath is a unicode,
  2657. # .//node does not match if a node is a direct child of . !
  2658. def compat_xpath(xpath):
  2659. if isinstance(xpath, compat_str):
  2660. xpath = xpath.encode('ascii')
  2661. return xpath
  2662. else:
  2663. compat_xpath = lambda xpath: xpath
  2664. compat_os_name = os._name if os.name == 'java' else os.name
  2665. if compat_os_name == 'nt':
  2666. def compat_shlex_quote(s):
  2667. return s if re.match(r'^[-_\w./]+$', s) else '"%s"' % s.replace('"', '\\"')
  2668. else:
  2669. try:
  2670. from shlex import quote as compat_shlex_quote
  2671. except ImportError: # Python < 3.3
  2672. def compat_shlex_quote(s):
  2673. if re.match(r'^[-_\w./]+$', s):
  2674. return s
  2675. else:
  2676. return "'" + s.replace("'", "'\"'\"'") + "'"
  2677. try:
  2678. args = shlex.split('中文')
  2679. assert (isinstance(args, list)
  2680. and isinstance(args[0], compat_str)
  2681. and args[0] == '中文')
  2682. compat_shlex_split = shlex.split
  2683. except (AssertionError, UnicodeEncodeError):
  2684. # Working around shlex issue with unicode strings on some python 2
  2685. # versions (see http://bugs.python.org/issue1548891)
  2686. def compat_shlex_split(s, comments=False, posix=True):
  2687. if isinstance(s, compat_str):
  2688. s = s.encode('utf-8')
  2689. return list(map(lambda s: s.decode('utf-8'), shlex.split(s, comments, posix)))
  2690. def compat_ord(c):
  2691. if type(c) is int:
  2692. return c
  2693. else:
  2694. return ord(c)
  2695. if sys.version_info >= (3, 0):
  2696. compat_getenv = os.getenv
  2697. compat_expanduser = os.path.expanduser
  2698. def compat_setenv(key, value, env=os.environ):
  2699. env[key] = value
  2700. else:
  2701. # Environment variables should be decoded with filesystem encoding.
  2702. # Otherwise it will fail if any non-ASCII characters present (see #3854 #3217 #2918)
  2703. def compat_getenv(key, default=None):
  2704. from .utils import get_filesystem_encoding
  2705. env = os.getenv(key, default)
  2706. if env:
  2707. env = env.decode(get_filesystem_encoding())
  2708. return env
  2709. def compat_setenv(key, value, env=os.environ):
  2710. def encode(v):
  2711. from .utils import get_filesystem_encoding
  2712. return v.encode(get_filesystem_encoding()) if isinstance(v, compat_str) else v
  2713. env[encode(key)] = encode(value)
  2714. # HACK: The default implementations of os.path.expanduser from cpython do not decode
  2715. # environment variables with filesystem encoding. We will work around this by
  2716. # providing adjusted implementations.
  2717. # The following are os.path.expanduser implementations from cpython 2.7.8 stdlib
  2718. # for different platforms with correct environment variables decoding.
  2719. if compat_os_name == 'posix':
  2720. def compat_expanduser(path):
  2721. """Expand ~ and ~user constructions. If user or $HOME is unknown,
  2722. do nothing."""
  2723. if not path.startswith('~'):
  2724. return path
  2725. i = path.find('/', 1)
  2726. if i < 0:
  2727. i = len(path)
  2728. if i == 1:
  2729. if 'HOME' not in os.environ:
  2730. import pwd
  2731. userhome = pwd.getpwuid(os.getuid()).pw_dir
  2732. else:
  2733. userhome = compat_getenv('HOME')
  2734. else:
  2735. import pwd
  2736. try:
  2737. pwent = pwd.getpwnam(path[1:i])
  2738. except KeyError:
  2739. return path
  2740. userhome = pwent.pw_dir
  2741. userhome = userhome.rstrip('/')
  2742. return (userhome + path[i:]) or '/'
  2743. elif compat_os_name in ('nt', 'ce'):
  2744. def compat_expanduser(path):
  2745. """Expand ~ and ~user constructs.
  2746. If user or $HOME is unknown, do nothing."""
  2747. if path[:1] != '~':
  2748. return path
  2749. i, n = 1, len(path)
  2750. while i < n and path[i] not in '/\\':
  2751. i = i + 1
  2752. if 'HOME' in os.environ:
  2753. userhome = compat_getenv('HOME')
  2754. elif 'USERPROFILE' in os.environ:
  2755. userhome = compat_getenv('USERPROFILE')
  2756. elif 'HOMEPATH' not in os.environ:
  2757. return path
  2758. else:
  2759. try:
  2760. drive = compat_getenv('HOMEDRIVE')
  2761. except KeyError:
  2762. drive = ''
  2763. userhome = os.path.join(drive, compat_getenv('HOMEPATH'))
  2764. if i != 1: # ~user
  2765. userhome = os.path.join(os.path.dirname(userhome), path[1:i])
  2766. return userhome + path[i:]
  2767. else:
  2768. compat_expanduser = os.path.expanduser
  2769. compat_os_path_expanduser = compat_expanduser
  2770. if compat_os_name == 'nt' and sys.version_info < (3, 8):
  2771. # os.path.realpath on Windows does not follow symbolic links
  2772. # prior to Python 3.8 (see https://bugs.python.org/issue9949)
  2773. def compat_realpath(path):
  2774. while os.path.islink(path):
  2775. path = os.path.abspath(os.readlink(path))
  2776. return path
  2777. else:
  2778. compat_realpath = os.path.realpath
  2779. compat_os_path_realpath = compat_realpath
  2780. if sys.version_info < (3, 0):
  2781. def compat_print(s):
  2782. from .utils import preferredencoding
  2783. print(s.encode(preferredencoding(), 'xmlcharrefreplace'))
  2784. else:
  2785. def compat_print(s):
  2786. assert isinstance(s, compat_str)
  2787. print(s)
  2788. if sys.version_info < (3, 0) and sys.platform == 'win32':
  2789. def compat_getpass(prompt, *args, **kwargs):
  2790. if isinstance(prompt, compat_str):
  2791. from .utils import preferredencoding
  2792. prompt = prompt.encode(preferredencoding())
  2793. return getpass.getpass(prompt, *args, **kwargs)
  2794. else:
  2795. compat_getpass = getpass.getpass
  2796. compat_getpass_getpass = compat_getpass
  2797. try:
  2798. compat_input = raw_input
  2799. except NameError: # Python 3
  2800. compat_input = input
  2801. # Python < 2.6.5 require kwargs to be bytes
  2802. try:
  2803. def _testfunc(x):
  2804. pass
  2805. _testfunc(**{'x': 0})
  2806. except TypeError:
  2807. def compat_kwargs(kwargs):
  2808. return dict((bytes(k), v) for k, v in kwargs.items())
  2809. else:
  2810. compat_kwargs = lambda kwargs: kwargs
  2811. try:
  2812. compat_numeric_types = (int, float, long, complex)
  2813. except NameError: # Python 3
  2814. compat_numeric_types = (int, float, complex)
  2815. try:
  2816. compat_integer_types = (int, long)
  2817. except NameError: # Python 3
  2818. compat_integer_types = (int, )
  2819. if sys.version_info < (2, 7):
  2820. def compat_socket_create_connection(address, timeout, source_address=None):
  2821. host, port = address
  2822. err = None
  2823. for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
  2824. af, socktype, proto, canonname, sa = res
  2825. sock = None
  2826. try:
  2827. sock = socket.socket(af, socktype, proto)
  2828. sock.settimeout(timeout)
  2829. if source_address:
  2830. sock.bind(source_address)
  2831. sock.connect(sa)
  2832. return sock
  2833. except socket.error as _:
  2834. err = _
  2835. if sock is not None:
  2836. sock.close()
  2837. if err is not None:
  2838. raise err
  2839. else:
  2840. raise socket.error('getaddrinfo returns an empty list')
  2841. else:
  2842. compat_socket_create_connection = socket.create_connection
  2843. # Fix https://github.com/ytdl-org/youtube-dl/issues/4223
  2844. # See http://bugs.python.org/issue9161 for what is broken
  2845. def workaround_optparse_bug9161():
  2846. op = optparse.OptionParser()
  2847. og = optparse.OptionGroup(op, 'foo')
  2848. try:
  2849. og.add_option('-t')
  2850. except TypeError:
  2851. real_add_option = optparse.OptionGroup.add_option
  2852. def _compat_add_option(self, *args, **kwargs):
  2853. enc = lambda v: (
  2854. v.encode('ascii', 'replace') if isinstance(v, compat_str)
  2855. else v)
  2856. bargs = [enc(a) for a in args]
  2857. bkwargs = dict(
  2858. (k, enc(v)) for k, v in kwargs.items())
  2859. return real_add_option(self, *bargs, **bkwargs)
  2860. optparse.OptionGroup.add_option = _compat_add_option
  2861. if hasattr(shutil, 'get_terminal_size'): # Python >= 3.3
  2862. compat_get_terminal_size = shutil.get_terminal_size
  2863. else:
  2864. _terminal_size = collections.namedtuple('terminal_size', ['columns', 'lines'])
  2865. def compat_get_terminal_size(fallback=(80, 24)):
  2866. from .utils import process_communicate_or_kill
  2867. columns = compat_getenv('COLUMNS')
  2868. if columns:
  2869. columns = int(columns)
  2870. else:
  2871. columns = None
  2872. lines = compat_getenv('LINES')
  2873. if lines:
  2874. lines = int(lines)
  2875. else:
  2876. lines = None
  2877. if columns is None or lines is None or columns <= 0 or lines <= 0:
  2878. try:
  2879. sp = subprocess.Popen(
  2880. ['stty', 'size'],
  2881. stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  2882. out, err = process_communicate_or_kill(sp)
  2883. _lines, _columns = map(int, out.split())
  2884. except Exception:
  2885. _columns, _lines = _terminal_size(*fallback)
  2886. if columns is None or columns <= 0:
  2887. columns = _columns
  2888. if lines is None or lines <= 0:
  2889. lines = _lines
  2890. return _terminal_size(columns, lines)
  2891. try:
  2892. itertools.count(start=0, step=1)
  2893. compat_itertools_count = itertools.count
  2894. except TypeError: # Python 2.6
  2895. def compat_itertools_count(start=0, step=1):
  2896. while True:
  2897. yield start
  2898. start += step
  2899. if sys.version_info >= (3, 0):
  2900. from tokenize import tokenize as compat_tokenize_tokenize
  2901. else:
  2902. from tokenize import generate_tokens as compat_tokenize_tokenize
  2903. try:
  2904. struct.pack('!I', 0)
  2905. except TypeError:
  2906. # In Python 2.6 and 2.7.x < 2.7.7, struct requires a bytes argument
  2907. # See https://bugs.python.org/issue19099
  2908. def compat_struct_pack(spec, *args):
  2909. if isinstance(spec, compat_str):
  2910. spec = spec.encode('ascii')
  2911. return struct.pack(spec, *args)
  2912. def compat_struct_unpack(spec, *args):
  2913. if isinstance(spec, compat_str):
  2914. spec = spec.encode('ascii')
  2915. return struct.unpack(spec, *args)
  2916. class compat_Struct(struct.Struct):
  2917. def __init__(self, fmt):
  2918. if isinstance(fmt, compat_str):
  2919. fmt = fmt.encode('ascii')
  2920. super(compat_Struct, self).__init__(fmt)
  2921. else:
  2922. compat_struct_pack = struct.pack
  2923. compat_struct_unpack = struct.unpack
  2924. if platform.python_implementation() == 'IronPython' and sys.version_info < (2, 7, 8):
  2925. class compat_Struct(struct.Struct):
  2926. def unpack(self, string):
  2927. if not isinstance(string, buffer): # noqa: F821
  2928. string = buffer(string) # noqa: F821
  2929. return super(compat_Struct, self).unpack(string)
  2930. else:
  2931. compat_Struct = struct.Struct
  2932. # compat_map/filter() returning an iterator, supposedly the
  2933. # same versioning as for zip below
  2934. try:
  2935. from future_builtins import map as compat_map
  2936. except ImportError:
  2937. try:
  2938. from itertools import imap as compat_map
  2939. except ImportError:
  2940. compat_map = map
  2941. try:
  2942. from future_builtins import filter as compat_filter
  2943. except ImportError:
  2944. try:
  2945. from itertools import ifilter as compat_filter
  2946. except ImportError:
  2947. compat_filter = filter
  2948. try:
  2949. from future_builtins import zip as compat_zip
  2950. except ImportError: # not 2.6+ or is 3.x
  2951. try:
  2952. from itertools import izip as compat_zip # < 2.5 or 3.x
  2953. except ImportError:
  2954. compat_zip = zip
  2955. # method renamed between Py2/3
  2956. try:
  2957. from itertools import zip_longest as compat_itertools_zip_longest
  2958. except ImportError:
  2959. from itertools import izip_longest as compat_itertools_zip_longest
  2960. # new class in collections
  2961. try:
  2962. from collections import ChainMap as compat_collections_chain_map
  2963. # Py3.3's ChainMap is deficient
  2964. if sys.version_info < (3, 4):
  2965. raise ImportError
  2966. except ImportError:
  2967. # Py <= 3.3
  2968. class compat_collections_chain_map(compat_collections_abc.MutableMapping):
  2969. maps = [{}]
  2970. def __init__(self, *maps):
  2971. self.maps = list(maps) or [{}]
  2972. def __getitem__(self, k):
  2973. for m in self.maps:
  2974. if k in m:
  2975. return m[k]
  2976. raise KeyError(k)
  2977. def __setitem__(self, k, v):
  2978. self.maps[0].__setitem__(k, v)
  2979. return
  2980. def __contains__(self, k):
  2981. return any((k in m) for m in self.maps)
  2982. def __delitem(self, k):
  2983. if k in self.maps[0]:
  2984. del self.maps[0][k]
  2985. return
  2986. raise KeyError(k)
  2987. def __delitem__(self, k):
  2988. self.__delitem(k)
  2989. def __iter__(self):
  2990. return itertools.chain(*reversed(self.maps))
  2991. def __len__(self):
  2992. return len(iter(self))
  2993. # to match Py3, don't del directly
  2994. def pop(self, k, *args):
  2995. if self.__contains__(k):
  2996. off = self.__getitem__(k)
  2997. self.__delitem(k)
  2998. return off
  2999. elif len(args) > 0:
  3000. return args[0]
  3001. raise KeyError(k)
  3002. def new_child(self, m=None, **kwargs):
  3003. m = m or {}
  3004. m.update(kwargs)
  3005. return compat_collections_chain_map(m, *self.maps)
  3006. @property
  3007. def parents(self):
  3008. return compat_collections_chain_map(*(self.maps[1:]))
  3009. # Pythons disagree on the type of a pattern (RegexObject, _sre.SRE_Pattern, Pattern, ...?)
  3010. compat_re_Pattern = type(re.compile(''))
  3011. # and on the type of a match
  3012. compat_re_Match = type(re.match('a', 'a'))
  3013. if sys.version_info < (3, 3):
  3014. def compat_b64decode(s, *args, **kwargs):
  3015. if isinstance(s, compat_str):
  3016. s = s.encode('ascii')
  3017. return base64.b64decode(s, *args, **kwargs)
  3018. else:
  3019. compat_b64decode = base64.b64decode
  3020. compat_base64_b64decode = compat_b64decode
  3021. if platform.python_implementation() == 'PyPy' and sys.pypy_version_info < (5, 4, 0):
  3022. # PyPy2 prior to version 5.4.0 expects byte strings as Windows function
  3023. # names, see the original PyPy issue [1] and the youtube-dl one [2].
  3024. # 1. https://bitbucket.org/pypy/pypy/issues/2360/windows-ctypescdll-typeerror-function-name
  3025. # 2. https://github.com/ytdl-org/youtube-dl/pull/4392
  3026. def compat_ctypes_WINFUNCTYPE(*args, **kwargs):
  3027. real = ctypes.WINFUNCTYPE(*args, **kwargs)
  3028. def resf(tpl, *args, **kwargs):
  3029. funcname, dll = tpl
  3030. return real((str(funcname), dll), *args, **kwargs)
  3031. return resf
  3032. else:
  3033. def compat_ctypes_WINFUNCTYPE(*args, **kwargs):
  3034. return ctypes.WINFUNCTYPE(*args, **kwargs)
  3035. if sys.version_info < (3, 0):
  3036. # open(file, mode='r', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True) not: opener=None
  3037. def compat_open(file_, *args, **kwargs):
  3038. if len(args) > 6 or 'opener' in kwargs:
  3039. raise ValueError('open: unsupported argument "opener"')
  3040. return io.open(file_, *args, **kwargs)
  3041. else:
  3042. compat_open = open
  3043. # compat_register_utf8
  3044. def compat_register_utf8():
  3045. if sys.platform == 'win32':
  3046. # https://github.com/ytdl-org/youtube-dl/issues/820
  3047. from codecs import register, lookup
  3048. register(
  3049. lambda name: lookup('utf-8') if name == 'cp65001' else None)
  3050. # compat_datetime_timedelta_total_seconds
  3051. try:
  3052. compat_datetime_timedelta_total_seconds = datetime.timedelta.total_seconds
  3053. except AttributeError:
  3054. # Py 2.6
  3055. def compat_datetime_timedelta_total_seconds(td):
  3056. return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
  3057. # optional decompression packages
  3058. # PyPi brotli package implements 'br' Content-Encoding
  3059. try:
  3060. import brotli as compat_brotli
  3061. except ImportError:
  3062. compat_brotli = None
  3063. # PyPi ncompress package implements 'compress' Content-Encoding
  3064. try:
  3065. import ncompress as compat_ncompress
  3066. except ImportError:
  3067. compat_ncompress = None
  3068. legacy = [
  3069. 'compat_HTMLParseError',
  3070. 'compat_HTMLParser',
  3071. 'compat_HTTPError',
  3072. 'compat_b64decode',
  3073. 'compat_cookiejar',
  3074. 'compat_cookiejar_Cookie',
  3075. 'compat_cookies',
  3076. 'compat_cookies_SimpleCookie',
  3077. 'compat_etree_Element',
  3078. 'compat_etree_register_namespace',
  3079. 'compat_expanduser',
  3080. 'compat_getpass',
  3081. 'compat_parse_qs',
  3082. 'compat_realpath',
  3083. 'compat_urllib_parse_parse_qs',
  3084. 'compat_urllib_parse_unquote',
  3085. 'compat_urllib_parse_unquote_plus',
  3086. 'compat_urllib_parse_unquote_to_bytes',
  3087. 'compat_urllib_parse_urlencode',
  3088. 'compat_urllib_parse_urlparse',
  3089. 'compat_urlparse',
  3090. 'compat_urlretrieve',
  3091. 'compat_xml_parse_error',
  3092. ]
  3093. __all__ = [
  3094. 'compat_html_parser_HTMLParseError',
  3095. 'compat_html_parser_HTMLParser',
  3096. 'compat_Struct',
  3097. 'compat_base64_b64decode',
  3098. 'compat_basestring',
  3099. 'compat_brotli',
  3100. 'compat_casefold',
  3101. 'compat_chr',
  3102. 'compat_collections_abc',
  3103. 'compat_collections_chain_map',
  3104. 'compat_datetime_timedelta_total_seconds',
  3105. 'compat_http_cookiejar',
  3106. 'compat_http_cookiejar_Cookie',
  3107. 'compat_http_cookies',
  3108. 'compat_http_cookies_SimpleCookie',
  3109. 'compat_ctypes_WINFUNCTYPE',
  3110. 'compat_etree_fromstring',
  3111. 'compat_filter',
  3112. 'compat_get_terminal_size',
  3113. 'compat_getenv',
  3114. 'compat_getpass_getpass',
  3115. 'compat_html_entities',
  3116. 'compat_html_entities_html5',
  3117. 'compat_http_client',
  3118. 'compat_http_server',
  3119. 'compat_input',
  3120. 'compat_integer_types',
  3121. 'compat_itertools_count',
  3122. 'compat_itertools_zip_longest',
  3123. 'compat_kwargs',
  3124. 'compat_map',
  3125. 'compat_ncompress',
  3126. 'compat_numeric_types',
  3127. 'compat_open',
  3128. 'compat_ord',
  3129. 'compat_os_name',
  3130. 'compat_os_path_expanduser',
  3131. 'compat_os_path_realpath',
  3132. 'compat_print',
  3133. 'compat_re_Match',
  3134. 'compat_re_Pattern',
  3135. 'compat_register_utf8',
  3136. 'compat_setenv',
  3137. 'compat_shlex_quote',
  3138. 'compat_shlex_split',
  3139. 'compat_socket_create_connection',
  3140. 'compat_str',
  3141. 'compat_struct_pack',
  3142. 'compat_struct_unpack',
  3143. 'compat_subprocess_get_DEVNULL',
  3144. 'compat_tokenize_tokenize',
  3145. 'compat_urllib_error',
  3146. 'compat_urllib_parse',
  3147. 'compat_urllib_request',
  3148. 'compat_urllib_request_DataHandler',
  3149. 'compat_urllib_response',
  3150. 'compat_urllib_request_urlretrieve',
  3151. 'compat_urllib_HTTPError',
  3152. 'compat_xml_etree_ElementTree_Element',
  3153. 'compat_xml_etree_ElementTree_ParseError',
  3154. 'compat_xml_etree_register_namespace',
  3155. 'compat_xpath',
  3156. 'compat_zip',
  3157. 'workaround_optparse_bug9161',
  3158. ]