You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3050 lines
92 KiB

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