logo

youtube-dl

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

compat.py (97147B)


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