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.

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