PageRenderTime 61ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/wacko/lib/SimplePie/library/SimplePie/Misc.php

https://bitbucket.org/wackowiki/wackowiki-dev
PHP | 2279 lines | 2217 code | 8 blank | 54 comment | 12 complexity | 7a73bf0ac78f4c3edfe60fe63894152b MD5 | raw file
Possible License(s): LGPL-3.0, GPL-2.0, LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * SimplePie
  4. *
  5. * A PHP-Based RSS and Atom Feed Framework.
  6. * Takes the hard work out of managing a complete RSS/Atom solution.
  7. *
  8. * Copyright (c) 2004-2016, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
  9. * All rights reserved.
  10. *
  11. * Redistribution and use in source and binary forms, with or without modification, are
  12. * permitted provided that the following conditions are met:
  13. *
  14. * * Redistributions of source code must retain the above copyright notice, this list of
  15. * conditions and the following disclaimer.
  16. *
  17. * * Redistributions in binary form must reproduce the above copyright notice, this list
  18. * of conditions and the following disclaimer in the documentation and/or other materials
  19. * provided with the distribution.
  20. *
  21. * * Neither the name of the SimplePie Team nor the names of its contributors may be used
  22. * to endorse or promote products derived from this software without specific prior
  23. * written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
  26. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  27. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
  28. * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  29. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  31. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  32. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. * POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. * @package SimplePie
  36. * @copyright 2004-2016 Ryan Parman, Geoffrey Sneddon, Ryan McCue
  37. * @author Ryan Parman
  38. * @author Geoffrey Sneddon
  39. * @author Ryan McCue
  40. * @link http://simplepie.org/ SimplePie
  41. * @license http://www.opensource.org/licenses/bsd-license.php BSD License
  42. */
  43. /**
  44. * Miscellanous utilities
  45. *
  46. * @package SimplePie
  47. */
  48. class SimplePie_Misc
  49. {
  50. public static function time_hms($seconds)
  51. {
  52. $time = '';
  53. $hours = floor($seconds / 3600);
  54. $remainder = $seconds % 3600;
  55. if ($hours > 0)
  56. {
  57. $time .= $hours.':';
  58. }
  59. $minutes = floor($remainder / 60);
  60. $seconds = $remainder % 60;
  61. if ($minutes < 10 && $hours > 0)
  62. {
  63. $minutes = '0' . $minutes;
  64. }
  65. if ($seconds < 10)
  66. {
  67. $seconds = '0' . $seconds;
  68. }
  69. $time .= $minutes.':';
  70. $time .= $seconds;
  71. return $time;
  72. }
  73. public static function absolutize_url($relative, $base)
  74. {
  75. $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
  76. if ($iri === false)
  77. {
  78. return false;
  79. }
  80. return $iri->get_uri();
  81. }
  82. /**
  83. * Get a HTML/XML element from a HTML string
  84. *
  85. * @deprecated Use DOMDocument instead (parsing HTML with regex is bad!)
  86. * @param string $realname Element name (including namespace prefix if applicable)
  87. * @param string $string HTML document
  88. * @return array
  89. */
  90. public static function get_element($realname, $string)
  91. {
  92. $return = array();
  93. $name = preg_quote($realname, '/');
  94. if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))
  95. {
  96. for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++)
  97. {
  98. $return[$i]['tag'] = $realname;
  99. $return[$i]['full'] = $matches[$i][0][0];
  100. $return[$i]['offset'] = $matches[$i][0][1];
  101. if (strlen($matches[$i][3][0]) <= 2)
  102. {
  103. $return[$i]['self_closing'] = true;
  104. }
  105. else
  106. {
  107. $return[$i]['self_closing'] = false;
  108. $return[$i]['content'] = $matches[$i][4][0];
  109. }
  110. $return[$i]['attribs'] = array();
  111. if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER))
  112. {
  113. for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++)
  114. {
  115. if (count($attribs[$j]) === 2)
  116. {
  117. $attribs[$j][2] = $attribs[$j][1];
  118. }
  119. $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]));
  120. }
  121. }
  122. }
  123. }
  124. return $return;
  125. }
  126. public static function element_implode($element)
  127. {
  128. $full = "<$element[tag]";
  129. foreach ($element['attribs'] as $key => $value)
  130. {
  131. $key = strtolower($key);
  132. $full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"';
  133. }
  134. if ($element['self_closing'])
  135. {
  136. $full .= ' />';
  137. }
  138. else
  139. {
  140. $full .= ">$element[content]</$element[tag]>";
  141. }
  142. return $full;
  143. }
  144. public static function error($message, $level, $file, $line)
  145. {
  146. if ((ini_get('error_reporting') & $level) > 0)
  147. {
  148. switch ($level)
  149. {
  150. case E_USER_ERROR:
  151. $note = 'PHP Error';
  152. break;
  153. case E_USER_WARNING:
  154. $note = 'PHP Warning';
  155. break;
  156. case E_USER_NOTICE:
  157. $note = 'PHP Notice';
  158. break;
  159. default:
  160. $note = 'Unknown Error';
  161. break;
  162. }
  163. $log_error = true;
  164. if (!function_exists('error_log'))
  165. {
  166. $log_error = false;
  167. }
  168. $log_file = @ini_get('error_log');
  169. if (!empty($log_file) && ('syslog' !== $log_file) && !@is_writable($log_file))
  170. {
  171. $log_error = false;
  172. }
  173. if ($log_error)
  174. {
  175. @error_log("$note: $message in $file on line $line", 0);
  176. }
  177. }
  178. return $message;
  179. }
  180. public static function fix_protocol($url, $http = 1)
  181. {
  182. $url = SimplePie_Misc::normalize_url($url);
  183. $parsed = SimplePie_Misc::parse_url($url);
  184. if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https')
  185. {
  186. return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http);
  187. }
  188. if ($parsed['scheme'] === '' && $parsed['authority'] === '' && !file_exists($url))
  189. {
  190. return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http);
  191. }
  192. if ($http === 2 && $parsed['scheme'] !== '')
  193. {
  194. return "feed:$url";
  195. }
  196. elseif ($http === 3 && strtolower($parsed['scheme']) === 'http')
  197. {
  198. return substr_replace($url, 'podcast', 0, 4);
  199. }
  200. elseif ($http === 4 && strtolower($parsed['scheme']) === 'http')
  201. {
  202. return substr_replace($url, 'itpc', 0, 4);
  203. }
  204. else
  205. {
  206. return $url;
  207. }
  208. }
  209. public static function array_merge_recursive($array1, $array2)
  210. {
  211. foreach ($array2 as $key => $value)
  212. {
  213. if (is_array($value))
  214. {
  215. $array1[$key] = SimplePie_Misc::array_merge_recursive($array1[$key], $value);
  216. }
  217. else
  218. {
  219. $array1[$key] = $value;
  220. }
  221. }
  222. return $array1;
  223. }
  224. public static function parse_url($url)
  225. {
  226. $iri = new SimplePie_IRI($url);
  227. return array(
  228. 'scheme' => (string) $iri->scheme,
  229. 'authority' => (string) $iri->authority,
  230. 'path' => (string) $iri->path,
  231. 'query' => (string) $iri->query,
  232. 'fragment' => (string) $iri->fragment
  233. );
  234. }
  235. public static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
  236. {
  237. $iri = new SimplePie_IRI('');
  238. $iri->scheme = $scheme;
  239. $iri->authority = $authority;
  240. $iri->path = $path;
  241. $iri->query = $query;
  242. $iri->fragment = $fragment;
  243. return $iri->get_uri();
  244. }
  245. public static function normalize_url($url)
  246. {
  247. $iri = new SimplePie_IRI($url);
  248. return $iri->get_uri();
  249. }
  250. public static function percent_encoding_normalization($match)
  251. {
  252. $integer = hexdec($match[1]);
  253. if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
  254. {
  255. return chr($integer);
  256. }
  257. else
  258. {
  259. return strtoupper($match[0]);
  260. }
  261. }
  262. /**
  263. * Converts a Windows-1252 encoded string to a UTF-8 encoded string
  264. *
  265. * @static
  266. * @param string $string Windows-1252 encoded string
  267. * @return string UTF-8 encoded string
  268. */
  269. public static function windows_1252_to_utf8($string)
  270. {
  271. static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF");
  272. return strtr($string, $convert_table);
  273. }
  274. /**
  275. * Change a string from one encoding to another
  276. *
  277. * @param string $data Raw data in $input encoding
  278. * @param string $input Encoding of $data
  279. * @param string $output Encoding you want
  280. * @return string|boolean False if we can't convert it
  281. */
  282. public static function change_encoding($data, $input, $output)
  283. {
  284. $input = SimplePie_Misc::encoding($input);
  285. $output = SimplePie_Misc::encoding($output);
  286. // We fail to fail on non US-ASCII bytes
  287. if ($input === 'US-ASCII')
  288. {
  289. static $non_ascii_octects = '';
  290. if (!$non_ascii_octects)
  291. {
  292. for ($i = 0x80; $i <= 0xFF; $i++)
  293. {
  294. $non_ascii_octects .= chr($i);
  295. }
  296. }
  297. $data = substr($data, 0, strcspn($data, $non_ascii_octects));
  298. }
  299. // This is first, as behaviour of this is completely predictable
  300. if ($input === 'windows-1252' && $output === 'UTF-8')
  301. {
  302. return SimplePie_Misc::windows_1252_to_utf8($data);
  303. }
  304. // This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported).
  305. elseif (function_exists('mb_convert_encoding') && ($return = SimplePie_Misc::change_encoding_mbstring($data, $input, $output)))
  306. {
  307. return $return;
  308. }
  309. // This is third, as behaviour of this varies with OS userland and PHP version
  310. elseif (function_exists('iconv') && ($return = SimplePie_Misc::change_encoding_iconv($data, $input, $output)))
  311. {
  312. return $return;
  313. }
  314. // This is last, as behaviour of this varies with OS userland and PHP version
  315. elseif (class_exists('\UConverter') && ($return = SimplePie_Misc::change_encoding_uconverter($data, $input, $output)))
  316. {
  317. return $return;
  318. }
  319. // If we can't do anything, just fail
  320. else
  321. {
  322. return false;
  323. }
  324. }
  325. protected static function change_encoding_mbstring($data, $input, $output)
  326. {
  327. if ($input === 'windows-949')
  328. {
  329. $input = 'EUC-KR';
  330. }
  331. if ($output === 'windows-949')
  332. {
  333. $output = 'EUC-KR';
  334. }
  335. if ($input === 'Windows-31J')
  336. {
  337. $input = 'SJIS';
  338. }
  339. if ($output === 'Windows-31J')
  340. {
  341. $output = 'SJIS';
  342. }
  343. // Check that the encoding is supported
  344. if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80")
  345. {
  346. return false;
  347. }
  348. if (!in_array($input, mb_list_encodings()))
  349. {
  350. return false;
  351. }
  352. // Let's do some conversion
  353. if ($return = @mb_convert_encoding($data, $output, $input))
  354. {
  355. return $return;
  356. }
  357. return false;
  358. }
  359. protected static function change_encoding_iconv($data, $input, $output)
  360. {
  361. return @iconv($input, $output, $data);
  362. }
  363. /**
  364. * @param string $data
  365. * @param string $input
  366. * @param string $output
  367. * @return string|false
  368. */
  369. protected static function change_encoding_uconverter($data, $input, $output)
  370. {
  371. return @\UConverter::transcode($data, $output, $input);
  372. }
  373. /**
  374. * Normalize an encoding name
  375. *
  376. * This is automatically generated by create.php
  377. *
  378. * To generate it, run `php create.php` on the command line, and copy the
  379. * output to replace this function.
  380. *
  381. * @param string $charset Character set to standardise
  382. * @return string Standardised name
  383. */
  384. public static function encoding($charset)
  385. {
  386. // Normalization from UTS #22
  387. switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset)))
  388. {
  389. case 'adobestandardencoding':
  390. case 'csadobestandardencoding':
  391. return 'Adobe-Standard-Encoding';
  392. case 'adobesymbolencoding':
  393. case 'cshppsmath':
  394. return 'Adobe-Symbol-Encoding';
  395. case 'ami1251':
  396. case 'amiga1251':
  397. return 'Amiga-1251';
  398. case 'ansix31101983':
  399. case 'csat5001983':
  400. case 'csiso99naplps':
  401. case 'isoir99':
  402. case 'naplps':
  403. return 'ANSI_X3.110-1983';
  404. case 'arabic7':
  405. case 'asmo449':
  406. case 'csiso89asmo449':
  407. case 'iso9036':
  408. case 'isoir89':
  409. return 'ASMO_449';
  410. case 'big5':
  411. case 'csbig5':
  412. return 'Big5';
  413. case 'big5hkscs':
  414. return 'Big5-HKSCS';
  415. case 'bocu1':
  416. case 'csbocu1':
  417. return 'BOCU-1';
  418. case 'brf':
  419. case 'csbrf':
  420. return 'BRF';
  421. case 'bs4730':
  422. case 'csiso4unitedkingdom':
  423. case 'gb':
  424. case 'iso646gb':
  425. case 'isoir4':
  426. case 'uk':
  427. return 'BS_4730';
  428. case 'bsviewdata':
  429. case 'csiso47bsviewdata':
  430. case 'isoir47':
  431. return 'BS_viewdata';
  432. case 'cesu8':
  433. case 'cscesu8':
  434. return 'CESU-8';
  435. case 'ca':
  436. case 'csa71':
  437. case 'csaz243419851':
  438. case 'csiso121canadian1':
  439. case 'iso646ca':
  440. case 'isoir121':
  441. return 'CSA_Z243.4-1985-1';
  442. case 'csa72':
  443. case 'csaz243419852':
  444. case 'csiso122canadian2':
  445. case 'iso646ca2':
  446. case 'isoir122':
  447. return 'CSA_Z243.4-1985-2';
  448. case 'csaz24341985gr':
  449. case 'csiso123csaz24341985gr':
  450. case 'isoir123':
  451. return 'CSA_Z243.4-1985-gr';
  452. case 'csiso139csn369103':
  453. case 'csn369103':
  454. case 'isoir139':
  455. return 'CSN_369103';
  456. case 'csdecmcs':
  457. case 'dec':
  458. case 'decmcs':
  459. return 'DEC-MCS';
  460. case 'csiso21german':
  461. case 'de':
  462. case 'din66003':
  463. case 'iso646de':
  464. case 'isoir21':
  465. return 'DIN_66003';
  466. case 'csdkus':
  467. case 'dkus':
  468. return 'dk-us';
  469. case 'csiso646danish':
  470. case 'dk':
  471. case 'ds2089':
  472. case 'iso646dk':
  473. return 'DS_2089';
  474. case 'csibmebcdicatde':
  475. case 'ebcdicatde':
  476. return 'EBCDIC-AT-DE';
  477. case 'csebcdicatdea':
  478. case 'ebcdicatdea':
  479. return 'EBCDIC-AT-DE-A';
  480. case 'csebcdiccafr':
  481. case 'ebcdiccafr':
  482. return 'EBCDIC-CA-FR';
  483. case 'csebcdicdkno':
  484. case 'ebcdicdkno':
  485. return 'EBCDIC-DK-NO';
  486. case 'csebcdicdknoa':
  487. case 'ebcdicdknoa':
  488. return 'EBCDIC-DK-NO-A';
  489. case 'csebcdices':
  490. case 'ebcdices':
  491. return 'EBCDIC-ES';
  492. case 'csebcdicesa':
  493. case 'ebcdicesa':
  494. return 'EBCDIC-ES-A';
  495. case 'csebcdicess':
  496. case 'ebcdicess':
  497. return 'EBCDIC-ES-S';
  498. case 'csebcdicfise':
  499. case 'ebcdicfise':
  500. return 'EBCDIC-FI-SE';
  501. case 'csebcdicfisea':
  502. case 'ebcdicfisea':
  503. return 'EBCDIC-FI-SE-A';
  504. case 'csebcdicfr':
  505. case 'ebcdicfr':
  506. return 'EBCDIC-FR';
  507. case 'csebcdicit':
  508. case 'ebcdicit':
  509. return 'EBCDIC-IT';
  510. case 'csebcdicpt':
  511. case 'ebcdicpt':
  512. return 'EBCDIC-PT';
  513. case 'csebcdicuk':
  514. case 'ebcdicuk':
  515. return 'EBCDIC-UK';
  516. case 'csebcdicus':
  517. case 'ebcdicus':
  518. return 'EBCDIC-US';
  519. case 'csiso111ecmacyrillic':
  520. case 'ecmacyrillic':
  521. case 'isoir111':
  522. case 'koi8e':
  523. return 'ECMA-cyrillic';
  524. case 'csiso17spanish':
  525. case 'es':
  526. case 'iso646es':
  527. case 'isoir17':
  528. return 'ES';
  529. case 'csiso85spanish2':
  530. case 'es2':
  531. case 'iso646es2':
  532. case 'isoir85':
  533. return 'ES2';
  534. case 'cseucpkdfmtjapanese':
  535. case 'eucjp':
  536. case 'extendedunixcodepackedformatforjapanese':
  537. return 'EUC-JP';
  538. case 'cseucfixwidjapanese':
  539. case 'extendedunixcodefixedwidthforjapanese':
  540. return 'Extended_UNIX_Code_Fixed_Width_for_Japanese';
  541. case 'gb18030':
  542. return 'GB18030';
  543. case 'chinese':
  544. case 'cp936':
  545. case 'csgb2312':
  546. case 'csiso58gb231280':
  547. case 'gb2312':
  548. case 'gb231280':
  549. case 'gbk':
  550. case 'isoir58':
  551. case 'ms936':
  552. case 'windows936':
  553. return 'GBK';
  554. case 'cn':
  555. case 'csiso57gb1988':
  556. case 'gb198880':
  557. case 'iso646cn':
  558. case 'isoir57':
  559. return 'GB_1988-80';
  560. case 'csiso153gost1976874':
  561. case 'gost1976874':
  562. case 'isoir153':
  563. case 'stsev35888':
  564. return 'GOST_19768-74';
  565. case 'csiso150':
  566. case 'csiso150greekccitt':
  567. case 'greekccitt':
  568. case 'isoir150':
  569. return 'greek-ccitt';
  570. case 'csiso88greek7':
  571. case 'greek7':
  572. case 'isoir88':
  573. return 'greek7';
  574. case 'csiso18greek7old':
  575. case 'greek7old':
  576. case 'isoir18':
  577. return 'greek7-old';
  578. case 'cshpdesktop':
  579. case 'hpdesktop':
  580. return 'HP-DeskTop';
  581. case 'cshplegal':
  582. case 'hplegal':
  583. return 'HP-Legal';
  584. case 'cshpmath8':
  585. case 'hpmath8':
  586. return 'HP-Math8';
  587. case 'cshppifont':
  588. case 'hppifont':
  589. return 'HP-Pi-font';
  590. case 'cshproman8':
  591. case 'hproman8':
  592. case 'r8':
  593. case 'roman8':
  594. return 'hp-roman8';
  595. case 'hzgb2312':
  596. return 'HZ-GB-2312';
  597. case 'csibmsymbols':
  598. case 'ibmsymbols':
  599. return 'IBM-Symbols';
  600. case 'csibmthai':
  601. case 'ibmthai':
  602. return 'IBM-Thai';
  603. case 'cp37':
  604. case 'csibm37':
  605. case 'ebcdiccpca':
  606. case 'ebcdiccpnl':
  607. case 'ebcdiccpus':
  608. case 'ebcdiccpwt':
  609. case 'ibm37':
  610. return 'IBM037';
  611. case 'cp38':
  612. case 'csibm38':
  613. case 'ebcdicint':
  614. case 'ibm38':
  615. return 'IBM038';
  616. case 'cp273':
  617. case 'csibm273':
  618. case 'ibm273':
  619. return 'IBM273';
  620. case 'cp274':
  621. case 'csibm274':
  622. case 'ebcdicbe':
  623. case 'ibm274':
  624. return 'IBM274';
  625. case 'cp275':
  626. case 'csibm275':
  627. case 'ebcdicbr':
  628. case 'ibm275':
  629. return 'IBM275';
  630. case 'csibm277':
  631. case 'ebcdiccpdk':
  632. case 'ebcdiccpno':
  633. case 'ibm277':
  634. return 'IBM277';
  635. case 'cp278':
  636. case 'csibm278':
  637. case 'ebcdiccpfi':
  638. case 'ebcdiccpse':
  639. case 'ibm278':
  640. return 'IBM278';
  641. case 'cp280':
  642. case 'csibm280':
  643. case 'ebcdiccpit':
  644. case 'ibm280':
  645. return 'IBM280';
  646. case 'cp281':
  647. case 'csibm281':
  648. case 'ebcdicjpe':
  649. case 'ibm281':
  650. return 'IBM281';
  651. case 'cp284':
  652. case 'csibm284':
  653. case 'ebcdiccpes':
  654. case 'ibm284':
  655. return 'IBM284';
  656. case 'cp285':
  657. case 'csibm285':
  658. case 'ebcdiccpgb':
  659. case 'ibm285':
  660. return 'IBM285';
  661. case 'cp290':
  662. case 'csibm290':
  663. case 'ebcdicjpkana':
  664. case 'ibm290':
  665. return 'IBM290';
  666. case 'cp297':
  667. case 'csibm297':
  668. case 'ebcdiccpfr':
  669. case 'ibm297':
  670. return 'IBM297';
  671. case 'cp420':
  672. case 'csibm420':
  673. case 'ebcdiccpar1':
  674. case 'ibm420':
  675. return 'IBM420';
  676. case 'cp423':
  677. case 'csibm423':
  678. case 'ebcdiccpgr':
  679. case 'ibm423':
  680. return 'IBM423';
  681. case 'cp424':
  682. case 'csibm424':
  683. case 'ebcdiccphe':
  684. case 'ibm424':
  685. return 'IBM424';
  686. case '437':
  687. case 'cp437':
  688. case 'cspc8codepage437':
  689. case 'ibm437':
  690. return 'IBM437';
  691. case 'cp500':
  692. case 'csibm500':
  693. case 'ebcdiccpbe':
  694. case 'ebcdiccpch':
  695. case 'ibm500':
  696. return 'IBM500';
  697. case 'cp775':
  698. case 'cspc775baltic':
  699. case 'ibm775':
  700. return 'IBM775';
  701. case '850':
  702. case 'cp850':
  703. case 'cspc850multilingual':
  704. case 'ibm850':
  705. return 'IBM850';
  706. case '851':
  707. case 'cp851':
  708. case 'csibm851':
  709. case 'ibm851':
  710. return 'IBM851';
  711. case '852':
  712. case 'cp852':
  713. case 'cspcp852':
  714. case 'ibm852':
  715. return 'IBM852';
  716. case '855':
  717. case 'cp855':
  718. case 'csibm855':
  719. case 'ibm855':
  720. return 'IBM855';
  721. case '857':
  722. case 'cp857':
  723. case 'csibm857':
  724. case 'ibm857':
  725. return 'IBM857';
  726. case 'ccsid858':
  727. case 'cp858':
  728. case 'ibm858':
  729. case 'pcmultilingual850euro':
  730. return 'IBM00858';
  731. case '860':
  732. case 'cp860':
  733. case 'csibm860':
  734. case 'ibm860':
  735. return 'IBM860';
  736. case '861':
  737. case 'cp861':
  738. case 'cpis':
  739. case 'csibm861':
  740. case 'ibm861':
  741. return 'IBM861';
  742. case '862':
  743. case 'cp862':
  744. case 'cspc862latinhebrew':
  745. case 'ibm862':
  746. return 'IBM862';
  747. case '863':
  748. case 'cp863':
  749. case 'csibm863':
  750. case 'ibm863':
  751. return 'IBM863';
  752. case 'cp864':
  753. case 'csibm864':
  754. case 'ibm864':
  755. return 'IBM864';
  756. case '865':
  757. case 'cp865':
  758. case 'csibm865':
  759. case 'ibm865':
  760. return 'IBM865';
  761. case '866':
  762. case 'cp866':
  763. case 'csibm866':
  764. case 'ibm866':
  765. return 'IBM866';
  766. case 'cp868':
  767. case 'cpar':
  768. case 'csibm868':
  769. case 'ibm868':
  770. return 'IBM868';
  771. case '869':
  772. case 'cp869':
  773. case 'cpgr':
  774. case 'csibm869':
  775. case 'ibm869':
  776. return 'IBM869';
  777. case 'cp870':
  778. case 'csibm870':
  779. case 'ebcdiccproece':
  780. case 'ebcdiccpyu':
  781. case 'ibm870':
  782. return 'IBM870';
  783. case 'cp871':
  784. case 'csibm871':
  785. case 'ebcdiccpis':
  786. case 'ibm871':
  787. return 'IBM871';
  788. case 'cp880':
  789. case 'csibm880':
  790. case 'ebcdiccyrillic':
  791. case 'ibm880':
  792. return 'IBM880';
  793. case 'cp891':
  794. case 'csibm891':
  795. case 'ibm891':
  796. return 'IBM891';
  797. case 'cp903':
  798. case 'csibm903':
  799. case 'ibm903':
  800. return 'IBM903';
  801. case '904':
  802. case 'cp904':
  803. case 'csibbm904':
  804. case 'ibm904':
  805. return 'IBM904';
  806. case 'cp905':
  807. case 'csibm905':
  808. case 'ebcdiccptr':
  809. case 'ibm905':
  810. return 'IBM905';
  811. case 'cp918':
  812. case 'csibm918':
  813. case 'ebcdiccpar2':
  814. case 'ibm918':
  815. return 'IBM918';
  816. case 'ccsid924':
  817. case 'cp924':
  818. case 'ebcdiclatin9euro':
  819. case 'ibm924':
  820. return 'IBM00924';
  821. case 'cp1026':
  822. case 'csibm1026':
  823. case 'ibm1026':
  824. return 'IBM1026';
  825. case 'ibm1047':
  826. return 'IBM1047';
  827. case 'ccsid1140':
  828. case 'cp1140':
  829. case 'ebcdicus37euro':
  830. case 'ibm1140':
  831. return 'IBM01140';
  832. case 'ccsid1141':
  833. case 'cp1141':
  834. case 'ebcdicde273euro':
  835. case 'ibm1141':
  836. return 'IBM01141';
  837. case 'ccsid1142':
  838. case 'cp1142':
  839. case 'ebcdicdk277euro':
  840. case 'ebcdicno277euro':
  841. case 'ibm1142':
  842. return 'IBM01142';
  843. case 'ccsid1143':
  844. case 'cp1143':
  845. case 'ebcdicfi278euro':
  846. case 'ebcdicse278euro':
  847. case 'ibm1143':
  848. return 'IBM01143';
  849. case 'ccsid1144':
  850. case 'cp1144':
  851. case 'ebcdicit280euro':
  852. case 'ibm1144':
  853. return 'IBM01144';
  854. case 'ccsid1145':
  855. case 'cp1145':
  856. case 'ebcdices284euro':
  857. case 'ibm1145':
  858. return 'IBM01145';
  859. case 'ccsid1146':
  860. case 'cp1146':
  861. case 'ebcdicgb285euro':
  862. case 'ibm1146':
  863. return 'IBM01146';
  864. case 'ccsid1147':
  865. case 'cp1147':
  866. case 'ebcdicfr297euro':
  867. case 'ibm1147':
  868. return 'IBM01147';
  869. case 'ccsid1148':
  870. case 'cp1148':
  871. case 'ebcdicinternational500euro':
  872. case 'ibm1148':
  873. return 'IBM01148';
  874. case 'ccsid1149':
  875. case 'cp1149':
  876. case 'ebcdicis871euro':
  877. case 'ibm1149':
  878. return 'IBM01149';
  879. case 'csiso143iecp271':
  880. case 'iecp271':
  881. case 'isoir143':
  882. return 'IEC_P27-1';
  883. case 'csiso49inis':
  884. case 'inis':
  885. case 'isoir49':
  886. return 'INIS';
  887. case 'csiso50inis8':
  888. case 'inis8':
  889. case 'isoir50':
  890. return 'INIS-8';
  891. case 'csiso51iniscyrillic':
  892. case 'iniscyrillic':
  893. case 'isoir51':
  894. return 'INIS-cyrillic';
  895. case 'csinvariant':
  896. case 'invariant':
  897. return 'INVARIANT';
  898. case 'iso2022cn':
  899. return 'ISO-2022-CN';
  900. case 'iso2022cnext':
  901. return 'ISO-2022-CN-EXT';
  902. case 'csiso2022jp':
  903. case 'iso2022jp':
  904. return 'ISO-2022-JP';
  905. case 'csiso2022jp2':
  906. case 'iso2022jp2':
  907. return 'ISO-2022-JP-2';
  908. case 'csiso2022kr':
  909. case 'iso2022kr':
  910. return 'ISO-2022-KR';
  911. case 'cswindows30latin1':
  912. case 'iso88591windows30latin1':
  913. return 'ISO-8859-1-Windows-3.0-Latin-1';
  914. case 'cswindows31latin1':
  915. case 'iso88591windows31latin1':
  916. return 'ISO-8859-1-Windows-3.1-Latin-1';
  917. case 'csisolatin2':
  918. case 'iso88592':
  919. case 'iso885921987':
  920. case 'isoir101':
  921. case 'l2':
  922. case 'latin2':
  923. return 'ISO-8859-2';
  924. case 'cswindows31latin2':
  925. case 'iso88592windowslatin2':
  926. return 'ISO-8859-2-Windows-Latin-2';
  927. case 'csisolatin3':
  928. case 'iso88593':
  929. case 'iso885931988':
  930. case 'isoir109':
  931. case 'l3':
  932. case 'latin3':
  933. return 'ISO-8859-3';
  934. case 'csisolatin4':
  935. case 'iso88594':
  936. case 'iso885941988':
  937. case 'isoir110':
  938. case 'l4':
  939. case 'latin4':
  940. return 'ISO-8859-4';
  941. case 'csisolatincyrillic':
  942. case 'cyrillic':
  943. case 'iso88595':
  944. case 'iso885951988':
  945. case 'isoir144':
  946. return 'ISO-8859-5';
  947. case 'arabic':
  948. case 'asmo708':
  949. case 'csisolatinarabic':
  950. case 'ecma114':
  951. case 'iso88596':
  952. case 'iso885961987':
  953. case 'isoir127':
  954. return 'ISO-8859-6';
  955. case 'csiso88596e':
  956. case 'iso88596e':
  957. return 'ISO-8859-6-E';
  958. case 'csiso88596i':
  959. case 'iso88596i':
  960. return 'ISO-8859-6-I';
  961. case 'csisolatingreek':
  962. case 'ecma118':
  963. case 'elot928':
  964. case 'greek':
  965. case 'greek8':
  966. case 'iso88597':
  967. case 'iso885971987':
  968. case 'isoir126':
  969. return 'ISO-8859-7';
  970. case 'csisolatinhebrew':
  971. case 'hebrew':
  972. case 'iso88598':
  973. case 'iso885981988':
  974. case 'isoir138':
  975. return 'ISO-8859-8';
  976. case 'csiso88598e':
  977. case 'iso88598e':
  978. return 'ISO-8859-8-E';
  979. case 'csiso88598i':
  980. case 'iso88598i':
  981. return 'ISO-8859-8-I';
  982. case 'cswindows31latin5':
  983. case 'iso88599windowslatin5':
  984. return 'ISO-8859-9-Windows-Latin-5';
  985. case 'csisolatin6':
  986. case 'iso885910':
  987. case 'iso8859101992':
  988. case 'isoir157':
  989. case 'l6':
  990. case 'latin6':
  991. return 'ISO-8859-10';
  992. case 'iso885913':
  993. return 'ISO-8859-13';
  994. case 'iso885914':
  995. case 'iso8859141998':
  996. case 'isoceltic':
  997. case 'isoir199':
  998. case 'l8':
  999. case 'latin8':
  1000. return 'ISO-8859-14';
  1001. case 'iso885915':
  1002. case 'latin9':
  1003. return 'ISO-8859-15';
  1004. case 'iso885916':
  1005. case 'iso8859162001':
  1006. case 'isoir226':
  1007. case 'l10':
  1008. case 'latin10':
  1009. return 'ISO-8859-16';
  1010. case 'iso10646j1':
  1011. return 'ISO-10646-J-1';
  1012. case 'csunicode':
  1013. case 'iso10646ucs2':
  1014. return 'ISO-10646-UCS-2';
  1015. case 'csucs4':
  1016. case 'iso10646ucs4':
  1017. return 'ISO-10646-UCS-4';
  1018. case 'csunicodeascii':
  1019. case 'iso10646ucsbasic':
  1020. return 'ISO-10646-UCS-Basic';
  1021. case 'csunicodelatin1':
  1022. case 'iso10646':
  1023. case 'iso10646unicodelatin1':
  1024. return 'ISO-10646-Unicode-Latin1';
  1025. case 'csiso10646utf1':
  1026. case 'iso10646utf1':
  1027. return 'ISO-10646-UTF-1';
  1028. case 'csiso115481':
  1029. case 'iso115481':
  1030. case 'isotr115481':
  1031. return 'ISO-11548-1';
  1032. case 'csiso90':
  1033. case 'isoir90':
  1034. return 'iso-ir-90';
  1035. case 'csunicodeibm1261':
  1036. case 'isounicodeibm1261':
  1037. return 'ISO-Unicode-IBM-1261';
  1038. case 'csunicodeibm1264':
  1039. case 'isounicodeibm1264':
  1040. return 'ISO-Unicode-IBM-1264';
  1041. case 'csunicodeibm1265':
  1042. case 'isounicodeibm1265':
  1043. return 'ISO-Unicode-IBM-1265';
  1044. case 'csunicodeibm1268':
  1045. case 'isounicodeibm1268':
  1046. return 'ISO-Unicode-IBM-1268';
  1047. case 'csunicodeibm1276':
  1048. case 'isounicodeibm1276':
  1049. return 'ISO-Unicode-IBM-1276';
  1050. case 'csiso646basic1983':
  1051. case 'iso646basic1983':
  1052. case 'ref':
  1053. return 'ISO_646.basic:1983';
  1054. case 'csiso2intlrefversion':
  1055. case 'irv':
  1056. case 'iso646irv1983':
  1057. case 'isoir2':
  1058. return 'ISO_646.irv:1983';
  1059. case 'csiso2033':
  1060. case 'e13b':
  1061. case 'iso20331983':
  1062. case 'isoir98':
  1063. return 'ISO_2033-1983';
  1064. case 'csiso5427cyrillic':
  1065. case 'iso5427':
  1066. case 'isoir37':
  1067. return 'ISO_5427';
  1068. case 'iso5427cyrillic1981':
  1069. case 'iso54271981':
  1070. case 'isoir54':
  1071. return 'ISO_5427:1981';
  1072. case 'csiso5428greek':
  1073. case 'iso54281980':
  1074. case 'isoir55':
  1075. return 'ISO_5428:1980';
  1076. case 'csiso6937add':
  1077. case 'iso6937225':
  1078. case 'isoir152':
  1079. return 'ISO_6937-2-25';
  1080. case 'csisotextcomm':
  1081. case 'iso69372add':
  1082. case 'isoir142':
  1083. return 'ISO_6937-2-add';
  1084. case 'csiso8859supp':
  1085. case 'iso8859supp':
  1086. case 'isoir154':
  1087. case 'latin125':
  1088. return 'ISO_8859-supp';
  1089. case 'csiso10367box':
  1090. case 'iso10367box':
  1091. case 'isoir155':
  1092. return 'ISO_10367-box';
  1093. case 'csiso15italian':
  1094. case 'iso646it':
  1095. case 'isoir15':
  1096. case 'it':
  1097. return 'IT';
  1098. case 'csiso13jisc6220jp':
  1099. case 'isoir13':
  1100. case 'jisc62201969':
  1101. case 'jisc62201969jp':
  1102. case 'katakana':
  1103. case 'x2017':
  1104. return 'JIS_C6220-1969-jp';
  1105. case 'csiso14jisc6220ro':
  1106. case 'iso646jp':
  1107. case 'isoir14':
  1108. case 'jisc62201969ro':
  1109. case 'jp':
  1110. return 'JIS_C6220-1969-ro';
  1111. case 'csiso42jisc62261978':
  1112. case 'isoir42':
  1113. case 'jisc62261978':
  1114. return 'JIS_C6226-1978';
  1115. case 'csiso87jisx208':
  1116. case 'isoir87':
  1117. case 'jisc62261983':
  1118. case 'jisx2081983':
  1119. case 'x208':
  1120. return 'JIS_C6226-1983';
  1121. case 'csiso91jisc62291984a':
  1122. case 'isoir91':
  1123. case 'jisc62291984a':
  1124. case 'jpocra':
  1125. return 'JIS_C6229-1984-a';
  1126. case 'csiso92jisc62991984b':
  1127. case 'iso646jpocrb':
  1128. case 'isoir92':
  1129. case 'jisc62291984b':
  1130. case 'jpocrb':
  1131. return 'JIS_C6229-1984-b';
  1132. case 'csiso93jis62291984badd':
  1133. case 'isoir93':
  1134. case 'jisc62291984badd':
  1135. case 'jpocrbadd':
  1136. return 'JIS_C6229-1984-b-add';
  1137. case 'csiso94jis62291984hand':
  1138. case 'isoir94':
  1139. case 'jisc62291984hand':
  1140. case 'jpocrhand':
  1141. return 'JIS_C6229-1984-hand';
  1142. case 'csiso95jis62291984handadd':
  1143. case 'isoir95':
  1144. case 'jisc62291984handadd':
  1145. case 'jpocrhandadd':
  1146. return 'JIS_C6229-1984-hand-add';
  1147. case 'csiso96jisc62291984kana':
  1148. case 'isoir96':
  1149. case 'jisc62291984kana':
  1150. return 'JIS_C6229-1984-kana';
  1151. case 'csjisencoding':
  1152. case 'jisencoding':
  1153. return 'JIS_Encoding';
  1154. case 'cshalfwidthkatakana':
  1155. case 'jisx201':
  1156. case 'x201':
  1157. return 'JIS_X0201';
  1158. case 'csiso159jisx2121990':
  1159. case 'isoir159':
  1160. case 'jisx2121990':
  1161. case 'x212':
  1162. return 'JIS_X0212-1990';
  1163. case 'csiso141jusib1002':
  1164. case 'iso646yu':
  1165. case 'isoir141':
  1166. case 'js':
  1167. case 'jusib1002':
  1168. case 'yu':
  1169. return 'JUS_I.B1.002';
  1170. case 'csiso147macedonian':
  1171. case 'isoir147':
  1172. case 'jusib1003mac':
  1173. case 'macedonian':
  1174. return 'JUS_I.B1.003-mac';
  1175. case 'csiso146serbian':
  1176. case 'isoir146':
  1177. case 'jusib1003serb':
  1178. case 'serbian':
  1179. return 'JUS_I.B1.003-serb';
  1180. case 'koi7switched':
  1181. return 'KOI7-switched';
  1182. case 'cskoi8r':
  1183. case 'koi8r':
  1184. return 'KOI8-R';
  1185. case 'koi8u':
  1186. return 'KOI8-U';
  1187. case 'csksc5636':
  1188. case 'iso646kr':
  1189. case 'ksc5636':
  1190. return 'KSC5636';
  1191. case 'cskz1048':
  1192. case 'kz1048':
  1193. case 'rk1048':
  1194. case 'strk10482002':
  1195. return 'KZ-1048';
  1196. case 'csiso19latingreek':
  1197. case 'isoir19':
  1198. case 'latingreek':
  1199. return 'latin-greek';
  1200. case 'csiso27latingreek1':
  1201. case 'isoir27':
  1202. case 'latingreek1':
  1203. return 'Latin-greek-1';
  1204. case 'csiso158lap':
  1205. case 'isoir158':
  1206. case 'lap':
  1207. case 'latinlap':
  1208. return 'latin-lap';
  1209. case 'csmacintosh':
  1210. case 'mac':
  1211. case 'macintosh':
  1212. return 'macintosh';
  1213. case 'csmicrosoftpublishing':
  1214. case 'microsoftpublishing':
  1215. return 'Microsoft-Publishing';
  1216. case 'csmnem':
  1217. case 'mnem':
  1218. return 'MNEM';
  1219. case 'csmnemonic':
  1220. case 'mnemonic':
  1221. return 'MNEMONIC';
  1222. case 'csiso86hungarian':
  1223. case 'hu':
  1224. case 'iso646hu':
  1225. case 'isoir86':
  1226. case 'msz77953':
  1227. return 'MSZ_7795.3';
  1228. case 'csnatsdano':
  1229. case 'isoir91':
  1230. case 'natsdano':
  1231. return 'NATS-DANO';
  1232. case 'csnatsdanoadd':
  1233. case 'isoir92':
  1234. case 'natsdanoadd':
  1235. return 'NATS-DANO-ADD';
  1236. case 'csnatssefi':
  1237. case 'isoir81':
  1238. case 'natssefi':
  1239. return 'NATS-SEFI';
  1240. case 'csnatssefiadd':
  1241. case 'isoir82':
  1242. case 'natssefiadd':
  1243. return 'NATS-SEFI-ADD';
  1244. case 'csiso151cuba':
  1245. case 'cuba':
  1246. case 'iso646cu':
  1247. case 'isoir151':
  1248. case 'ncnc1081':
  1249. return 'NC_NC00-10:81';
  1250. case 'csiso69french':
  1251. case 'fr':
  1252. case 'iso646fr':
  1253. case 'isoir69':
  1254. case 'nfz62010':
  1255. return 'NF_Z_62-010';
  1256. case 'csiso25french':
  1257. case 'iso646fr1':
  1258. case 'isoir25':
  1259. case 'nfz620101973':
  1260. return 'NF_Z_62-010_(1973)';
  1261. case 'csiso60danishnorwegian':
  1262. case 'csiso60norwegian1':
  1263. case 'iso646no':
  1264. case 'isoir60':
  1265. case 'no':
  1266. case 'ns45511':
  1267. return 'NS_4551-1';
  1268. case 'csiso61norwegian2':
  1269. case 'iso646no2':
  1270. case 'isoir61':
  1271. case 'no2':
  1272. case 'ns45512':
  1273. return 'NS_4551-2';
  1274. case 'osdebcdicdf3irv':
  1275. return 'OSD_EBCDIC_DF03_IRV';
  1276. case 'osdebcdicdf41':
  1277. return 'OSD_EBCDIC_DF04_1';
  1278. case 'osdebcdicdf415':
  1279. return 'OSD_EBCDIC_DF04_15';
  1280. case 'cspc8danishnorwegian':
  1281. case 'pc8danishnorwegian':
  1282. return 'PC8-Danish-Norwegian';
  1283. case 'cspc8turkish':
  1284. case 'pc8turkish':
  1285. return 'PC8-Turkish';
  1286. case 'csiso16portuguese':
  1287. case 'iso646pt':
  1288. case 'isoir16':
  1289. case 'pt':
  1290. return 'PT';
  1291. case 'csiso84portuguese2':
  1292. case 'iso646pt2':
  1293. case 'isoir84':
  1294. case 'pt2':
  1295. return 'PT2';
  1296. case 'cp154':
  1297. case 'csptcp154':
  1298. case 'cyrillicasian':
  1299. case 'pt154':
  1300. case 'ptcp154':
  1301. return 'PTCP154';
  1302. case 'scsu':
  1303. return 'SCSU';
  1304. case 'csiso10swedish':
  1305. case 'fi':
  1306. case 'iso646fi':
  1307. case 'iso646se':
  1308. case 'isoir10':
  1309. case 'se':
  1310. case 'sen850200b':
  1311. return 'SEN_850200_B';
  1312. case 'csiso11swedishfornames':
  1313. case 'iso646se2':
  1314. case 'isoir11':
  1315. case 'se2':
  1316. case 'sen850200c':
  1317. return 'SEN_850200_C';
  1318. case 'csiso102t617bit':
  1319. case 'isoir102':
  1320. case 't617bit':
  1321. return 'T.61-7bit';
  1322. case 'csiso103t618bit':
  1323. case 'isoir103':
  1324. case 't61':
  1325. case 't618bit':
  1326. return 'T.61-8bit';
  1327. case 'csiso128t101g2':
  1328. case 'isoir128':
  1329. case 't101g2':
  1330. return 'T.101-G2';
  1331. case 'cstscii':
  1332. case 'tscii':
  1333. return 'TSCII';
  1334. case 'csunicode11':
  1335. case 'unicode11':
  1336. return 'UNICODE-1-1';
  1337. case 'csunicode11utf7':
  1338. case 'unicode11utf7':
  1339. return 'UNICODE-1-1-UTF-7';
  1340. case 'csunknown8bit':
  1341. case 'unknown8bit':
  1342. return 'UNKNOWN-8BIT';
  1343. case 'ansix341968':
  1344. case 'ansix341986':
  1345. case 'ascii':
  1346. case 'cp367':
  1347. case 'csascii':
  1348. case 'ibm367':
  1349. case 'iso646irv1991':
  1350. case 'iso646us':
  1351. case 'isoir6':
  1352. case 'us':
  1353. case 'usascii':
  1354. return 'US-ASCII';
  1355. case 'csusdk':
  1356. case 'usdk':
  1357. return 'us-dk';
  1358. case 'utf7':
  1359. return 'UTF-7';
  1360. case 'utf8':
  1361. return 'UTF-8';
  1362. case 'utf16':
  1363. return 'UTF-16';
  1364. case 'utf16be':
  1365. return 'UTF-16BE';
  1366. case 'utf16le':
  1367. return 'UTF-16LE';
  1368. case 'utf32':
  1369. return 'UTF-32';
  1370. case 'utf32be':
  1371. return 'UTF-32BE';
  1372. case 'utf32le':
  1373. return 'UTF-32LE';
  1374. case 'csventurainternational':
  1375. case 'venturainternational':
  1376. return 'Ventura-International';
  1377. case 'csventuramath':
  1378. case 'venturamath':
  1379. return 'Ventura-Math';
  1380. case 'csventuraus':
  1381. case 'venturaus':
  1382. return 'Ventura-US';
  1383. case 'csiso70videotexsupp1':
  1384. case 'isoir70':
  1385. case 'videotexsuppl':
  1386. return 'videotex-suppl';
  1387. case 'csviqr':
  1388. case 'viqr':
  1389. return 'VIQR';
  1390. case 'csviscii':
  1391. case 'viscii':
  1392. return 'VISCII';
  1393. case 'csshiftjis':
  1394. case 'cswindows31j':
  1395. case 'mskanji':
  1396. case 'shiftjis':
  1397. case 'windows31j':
  1398. return 'Windows-31J';
  1399. case 'iso885911':
  1400. case 'tis620':
  1401. return 'windows-874';
  1402. case 'cseuckr':
  1403. case 'csksc56011987':
  1404. case 'euckr':
  1405. case 'isoir149':
  1406. case 'korean':
  1407. case 'ksc5601':
  1408. case 'ksc56011987':
  1409. case 'ksc56011989':
  1410. case 'windows949':
  1411. return 'windows-949';
  1412. case 'windows1250':
  1413. return 'windows-1250';
  1414. case 'windows1251':
  1415. return 'windows-1251';
  1416. case 'cp819':
  1417. case 'csisolatin1':
  1418. case 'ibm819':
  1419. case 'iso88591':
  1420. case 'iso885911987':
  1421. case 'isoir100':
  1422. case 'l1':
  1423. case 'latin1':
  1424. case 'windows1252':
  1425. return 'windows-1252';
  1426. case 'windows1253':
  1427. return 'windows-1253';
  1428. case 'csisolatin5':
  1429. case 'iso88599':
  1430. case 'iso885991989':
  1431. case 'isoir148':
  1432. case 'l5':
  1433. case 'latin5':
  1434. case 'windows1254':
  1435. return 'windows-1254';
  1436. case 'windows1255':
  1437. return 'windows-1255';
  1438. case 'windows1256':
  1439. return 'windows-1256';
  1440. case 'windows1257':
  1441. return 'windows-1257';
  1442. case 'windows1258':
  1443. return 'windows-1258';
  1444. default:
  1445. return $charset;
  1446. }
  1447. }
  1448. public static function get_curl_version()
  1449. {
  1450. if (is_array($curl = curl_version()))
  1451. {
  1452. $curl = $curl['version'];
  1453. }
  1454. elseif (substr($curl, 0, 5) === 'curl/')
  1455. {
  1456. $curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5));
  1457. }
  1458. elseif (substr($curl, 0, 8) === 'libcurl/')
  1459. {
  1460. $curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8));
  1461. }
  1462. else
  1463. {
  1464. $curl = 0;
  1465. }
  1466. return $curl;
  1467. }
  1468. /**
  1469. * Strip HTML comments
  1470. *
  1471. * @param string $data Data to strip comments from
  1472. * @return string Comment stripped string
  1473. */
  1474. public static function strip_comments($data)
  1475. {
  1476. $output = '';
  1477. while (($start = strpos($data, '<!--')) !== false)
  1478. {
  1479. $output .= substr($data, 0, $start);
  1480. if (($end = strpos($data, '-->', $start)) !== false)
  1481. {
  1482. $data = substr_replace($data, '', 0, $end + 3);
  1483. }
  1484. else
  1485. {
  1486. $data = '';
  1487. }
  1488. }
  1489. return $output . $data;
  1490. }
  1491. public static function parse_date($dt)
  1492. {
  1493. $parser = SimplePie_Parse_Date::get();
  1494. return $parser->parse($dt);
  1495. }
  1496. /**
  1497. * Decode HTML entities
  1498. *
  1499. * @deprecated Use DOMDocument instead
  1500. * @param string $data Input data
  1501. * @return string Output data
  1502. */
  1503. public static function entities_decode($data)
  1504. {
  1505. $decoder = new SimplePie_Decode_HTML_Entities($data);
  1506. return $decoder->parse();
  1507. }
  1508. /**
  1509. * Remove RFC822 comments
  1510. *
  1511. * @param string $data Data to strip comments from
  1512. * @return string Comment stripped string
  1513. */
  1514. public static function uncomment_rfc822($string)
  1515. {
  1516. $string = (string) $string;
  1517. $position = 0;
  1518. $length = strlen($string);
  1519. $depth = 0;
  1520. $output = '';
  1521. while ($position < $length && ($pos = strpos($string, '(', $position)) !== false)
  1522. {
  1523. $output .= substr($string, $position, $pos - $position);
  1524. $position = $pos + 1;
  1525. if ($string[$pos - 1] !== '\\')
  1526. {
  1527. $depth++;
  1528. while ($depth && $position < $length)
  1529. {
  1530. $position += strcspn($string, '()', $position);
  1531. if ($string[$position - 1] === '\\')
  1532. {
  1533. $position++;
  1534. continue;
  1535. }
  1536. elseif (isset($string[$position]))
  1537. {
  1538. switch ($string[$position])
  1539. {
  1540. case '(':
  1541. $depth++;
  1542. break;
  1543. case ')':
  1544. $depth--;
  1545. break;
  1546. }
  1547. $position++;
  1548. }
  1549. else
  1550. {
  1551. break;
  1552. }
  1553. }
  1554. }
  1555. else
  1556. {
  1557. $output .= '(';
  1558. }
  1559. }
  1560. $output .= substr($string, $position);
  1561. return $output;
  1562. }
  1563. public static function parse_mime($mime)
  1564. {
  1565. if (($pos = strpos($mime, ';')) === false)
  1566. {
  1567. return trim($mime);
  1568. }
  1569. else
  1570. {
  1571. return trim(substr($mime, 0, $pos));
  1572. }
  1573. }
  1574. public static function atom_03_construct_type($attribs)
  1575. {
  1576. if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
  1577. {
  1578. $mode = SIMPLEPIE_CONSTRUCT_BASE64;
  1579. }
  1580. else
  1581. {
  1582. $mode = SIMPLEPIE_CONSTRUCT_NONE;
  1583. }
  1584. if (isset($attribs['']['type']))
  1585. {
  1586. switch (strtolower(trim($attribs['']['type'])))
  1587. {
  1588. case 'text':
  1589. case 'text/plain':
  1590. return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
  1591. case 'html':
  1592. case 'text/html':
  1593. return SIMPLEPIE_CONSTRUCT_HTML | $mode;
  1594. case 'xhtml':
  1595. case 'application/xhtml+xml':
  1596. return SIMPLEPIE_CONSTRUCT_XHTML | $mode;
  1597. default:
  1598. return SIMPLEPIE_CONSTRUCT_NONE | $mode;
  1599. }
  1600. }
  1601. else
  1602. {
  1603. return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
  1604. }
  1605. }
  1606. public static function atom_10_construct_type($attribs)
  1607. {
  1608. if (isset($attribs['']['type']))
  1609. {
  1610. switch (strtolower(trim($attribs['']['type'])))
  1611. {
  1612. case 'text':
  1613. return SIMPLEPIE_CONSTRUCT_TEXT;
  1614. case 'html':
  1615. return SIMPLEPIE_CONSTRUCT_HTML;
  1616. case 'xhtml':
  1617. return SIMPLEPIE_CONSTRUCT_XHTML;
  1618. default:
  1619. return SIMPLEPIE_CONSTRUCT_NONE;
  1620. }
  1621. }
  1622. return SIMPLEPIE_CONSTRUCT_TEXT;
  1623. }
  1624. public static function atom_10_content_construct_type($attribs)
  1625. {
  1626. if (isset($attribs['']['type']))
  1627. {
  1628. $type = strtolower(trim($attribs['']['type']));
  1629. switch ($type)
  1630. {
  1631. case 'text':
  1632. return SIMPLEPIE_CONSTRUCT_TEXT;
  1633. case 'html':
  1634. return SIMPLEPIE_CONSTRUCT_HTML;
  1635. case 'xhtml':
  1636. return SIMPLEPIE_CONSTRUCT_XHTML;
  1637. }
  1638. if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/')
  1639. {
  1640. return SIMPLEPIE_CONSTRUCT_NONE;
  1641. }
  1642. else
  1643. {
  1644. return SIMPLEPIE_CONSTRUCT_BASE64;
  1645. }
  1646. }
  1647. else
  1648. {
  1649. return SIMPLEPIE_CONSTRUCT_TEXT;
  1650. }
  1651. }
  1652. public static function is_isegment_nz_nc($string)
  1653. {
  1654. return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string);
  1655. }
  1656. public static function space_separated_tokens($string)
  1657. {
  1658. $space_characters = "\x20\x09\x0A\x0B\x0C\x0D";
  1659. $string_length = strlen($string);
  1660. $position = strspn($string, $space_characters);
  1661. $tokens = array();
  1662. while ($position < $string_length)
  1663. {
  1664. $len = strcspn($string, $space_characters, $position);
  1665. $tokens[] = substr($string, $position, $len);
  1666. $position += $len;
  1667. $position += strspn($string, $space_characters, $position);
  1668. }
  1669. return $tokens;
  1670. }
  1671. /**
  1672. * Converts a unicode codepoint to a UTF-8 character
  1673. *
  1674. * @static
  1675. * @param int $codepoint Unicode codepoint
  1676. * @return string UTF-8 character
  1677. */
  1678. public static function codepoint_to_utf8($codepoint)
  1679. {
  1680. $codepoint = (int) $codepoint;
  1681. if ($codepoint < 0)
  1682. {
  1683. return false;
  1684. }
  1685. else if ($codepoint <= 0x7f)
  1686. {
  1687. return chr($codepoint);
  1688. }
  1689. else if ($codepoint <= 0x7ff)
  1690. {
  1691. return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
  1692. }
  1693. else if ($codepoint <= 0xffff)
  1694. {
  1695. return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
  1696. }
  1697. else if ($codepoint <= 0x10ffff)
  1698. {
  1699. return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
  1700. }
  1701. else
  1702. {
  1703. // U+FFFD REPLACEMENT CHARACTER
  1704. return "\xEF\xBF\xBD";
  1705. }
  1706. }
  1707. /**
  1708. * Similar to parse_str()
  1709. *
  1710. * Returns an associative array of name/value pairs, where the value is an
  1711. * array of values that have used the same name
  1712. *
  1713. * @static
  1714. * @param string $str The input string.
  1715. * @return array
  1716. */
  1717. public static function parse_str($str)
  1718. {
  1719. $return = array();
  1720. $str = explode('&', $str);
  1721. foreach ($str as $section)
  1722. {
  1723. if (strpos($section, '=') !== false)
  1724. {
  1725. list($name, $value) = explode('=', $section, 2);
  1726. $return[urldecode($name)][] = urldecode($value);
  1727. }
  1728. else
  1729. {
  1730. $return[urldecode($section)][] = null;
  1731. }
  1732. }
  1733. return $return;
  1734. }
  1735. /**
  1736. * Detect XML encoding, as per XML 1.0 Appendix F.1
  1737. *
  1738. * @todo Add support for EBCDIC
  1739. * @param string $data XML data
  1740. * @param SimplePie_Registry $registry Class registry
  1741. * @return array Possible encodings
  1742. */
  1743. public static function xml_encoding($data, $registry)
  1744. {
  1745. // UTF-32 Big Endian BOM
  1746. if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
  1747. {
  1748. $encoding[] = 'UTF-32BE';
  1749. }
  1750. // UTF-32 Little Endian BOM
  1751. elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00")
  1752. {
  1753. $encoding[] = 'UTF-32LE';
  1754. }
  1755. // UTF-16 Big Endian BOM
  1756. elseif (substr($data, 0, 2) === "\xFE\xFF")
  1757. {
  1758. $encoding[] = 'UTF-16BE';
  1759. }
  1760. // UTF-16 Little Endian BOM
  1761. elseif (substr($data, 0, 2) === "\xFF\xFE")
  1762. {
  1763. $encoding[] = 'UTF-16LE';
  1764. }
  1765. // UTF-8 BOM
  1766. elseif (substr($data, 0, 3) === "\xEF\xBB\xBF")
  1767. {
  1768. $encoding[] = 'UTF-8';
  1769. }
  1770. // UTF-32 Big Endian Without BOM
  1771. elseif (substr($data, 0, 20) === "\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C")
  1772. {
  1773. if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E"))
  1774. {
  1775. $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8')));
  1776. if ($parser->parse())
  1777. {
  1778. $encoding[] = $parser->encoding;
  1779. }
  1780. }
  1781. $encoding[] = 'UTF-32BE';
  1782. }
  1783. // UTF-32 Little Endian Without BOM
  1784. elseif (substr($data, 0, 20) === "\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00")
  1785. {
  1786. if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00"))
  1787. {
  1788. $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8')));
  1789. if ($parser->parse())
  1790. {
  1791. $encoding[] = $parser->encoding;
  1792. }
  1793. }
  1794. $encoding[] = 'UTF-32LE';
  1795. }
  1796. // UTF-16 Big Endian Without BOM
  1797. elseif (substr($data, 0, 10) === "\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C")
  1798. {
  1799. if ($pos = strpos($data, "\x00\x3F\x00\x3E"))
  1800. {
  1801. $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8')));
  1802. if ($parser->parse())
  1803. {
  1804. $encoding[] = $parser->encoding;
  1805. }
  1806. }
  1807. $encoding[] = 'UTF-16BE';
  1808. }
  1809. // UTF-16 Little Endian Without BOM
  1810. elseif (substr($data, 0, 10) === "\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00")
  1811. {
  1812. if ($pos = strpos($data, "\x3F\x00\x3E\x00"))
  1813. {
  1814. $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8')));
  1815. if ($parser->parse())
  1816. {
  1817. $encoding[] = $parser->encoding;
  1818. }
  1819. }
  1820. $encoding[] = 'UTF-16LE';
  1821. }
  1822. // US-ASCII (or superset)
  1823. elseif (substr($data, 0, 5) === "\x3C\x3F\x78\x6D\x6C")
  1824. {
  1825. if ($pos = strpos($data, "\x3F\x3E"))
  1826. {
  1827. $parser = $registry->create('XML_Declaration_Parser', array(substr($data, 5, $pos - 5)));
  1828. if ($parser->parse())
  1829. {
  1830. $encoding[] = $parser->encoding;
  1831. }
  1832. }
  1833. $encoding[] = 'UTF-8';
  1834. }
  1835. // Fallback to UTF-8
  1836. else
  1837. {
  1838. $encoding[] = 'UTF-8';
  1839. }
  1840. return $encoding;
  1841. }
  1842. public static function output_javascript()
  1843. {
  1844. if (function_exists('ob_gzhandler'))
  1845. {
  1846. ob_start('ob_gzhandler');
  1847. }
  1848. header('Content-type: text/javascript; charset: UTF-8');
  1849. header('Cache-Control: must-revalidate');
  1850. header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
  1851. ?>
  1852. function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
  1853. if (placeholder != '') {
  1854. document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
  1855. }
  1856. else {
  1857. document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
  1858. }
  1859. }
  1860. function embed_flash(bgcolor, width, height, link, loop, type) {
  1861. document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>');
  1862. }
  1863. function embed_flv(width, height, link, placeholder, loop, player) {
  1864. document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="tr…

Large files files are truncated, but you can click here to view the full file