84e03da5c7
While investigating something else in Shared, I noticed that CodePage had poor test coverage and a high complexity rating. This change addresses both; Scrutinizer would love it, although its interface on GitHub seems broken at the moment (all PRs show "Waiting for External Code Coverage").
275 lines
3.7 KiB
PHP
275 lines
3.7 KiB
PHP
<?php
|
|
|
|
return [
|
|
// ANSI Latin I (BIFF4-BIFF7)
|
|
[
|
|
'CP1252',
|
|
0,
|
|
],
|
|
// ASCII
|
|
[
|
|
'ASCII',
|
|
367,
|
|
],
|
|
// OEM US
|
|
[
|
|
'CP437',
|
|
437,
|
|
],
|
|
// OEM Greek
|
|
[
|
|
'CP737',
|
|
737,
|
|
],
|
|
// OEM Baltic
|
|
[
|
|
'CP775',
|
|
775,
|
|
],
|
|
// OEM Latin I
|
|
[
|
|
'CP850',
|
|
850,
|
|
],
|
|
// OEM Latin II (Central European)
|
|
[
|
|
'CP852',
|
|
852,
|
|
],
|
|
// OEM Cyrillic
|
|
[
|
|
'CP855',
|
|
855,
|
|
],
|
|
// OEM Turkish
|
|
[
|
|
'CP857',
|
|
857,
|
|
],
|
|
// OEM Multilingual Latin I with Euro
|
|
[
|
|
'CP858',
|
|
858,
|
|
],
|
|
// OEM Portugese
|
|
[
|
|
'CP860',
|
|
860,
|
|
],
|
|
// OEM Icelandic
|
|
[
|
|
'CP861',
|
|
861,
|
|
],
|
|
// OEM Hebrew
|
|
[
|
|
'CP862',
|
|
862,
|
|
],
|
|
// OEM Canadian (French)
|
|
[
|
|
'CP863',
|
|
863,
|
|
],
|
|
// OEM Arabic
|
|
[
|
|
'CP864',
|
|
864,
|
|
],
|
|
// OEM Nordic
|
|
[
|
|
'CP865',
|
|
865,
|
|
],
|
|
// OEM Cyrillic (Russian)
|
|
[
|
|
'CP866',
|
|
866,
|
|
],
|
|
// OEM Greek (Modern)
|
|
[
|
|
'CP869',
|
|
869,
|
|
],
|
|
// ANSI Thai
|
|
[
|
|
'CP874',
|
|
874,
|
|
],
|
|
// ANSI Japanese Shift-JIS
|
|
[
|
|
'CP932',
|
|
932,
|
|
],
|
|
// ANSI Chinese Simplified GBK
|
|
[
|
|
'CP936',
|
|
936,
|
|
],
|
|
// ANSI Korean (Wansung)
|
|
[
|
|
'CP949',
|
|
949,
|
|
],
|
|
// ANSI Chinese Traditional BIG5
|
|
[
|
|
'CP950',
|
|
950,
|
|
],
|
|
// UTF-16 (BIFF8)
|
|
[
|
|
'UTF-16LE',
|
|
1200,
|
|
],
|
|
// ANSI Latin II (Central European)
|
|
[
|
|
'CP1250',
|
|
1250,
|
|
],
|
|
// ANSI Cyrillic
|
|
[
|
|
'CP1251',
|
|
1251,
|
|
],
|
|
// ANSI Latin I (BIFF4-BIFF7)
|
|
[
|
|
'CP1252',
|
|
1252,
|
|
],
|
|
// ANSI Greek
|
|
[
|
|
'CP1253',
|
|
1253,
|
|
],
|
|
// ANSI Turkish
|
|
[
|
|
'CP1254',
|
|
1254,
|
|
],
|
|
// ANSI Hebrew
|
|
[
|
|
'CP1255',
|
|
1255,
|
|
],
|
|
// ANSI Arabic
|
|
[
|
|
'CP1256',
|
|
1256,
|
|
],
|
|
// ANSI Baltic
|
|
[
|
|
'CP1257',
|
|
1257,
|
|
],
|
|
// ANSI Vietnamese
|
|
[
|
|
'CP1258',
|
|
1258,
|
|
],
|
|
// ANSI Korean (Johab)
|
|
[
|
|
'CP1361',
|
|
1361,
|
|
],
|
|
// Apple Roman
|
|
[
|
|
'MAC',
|
|
10000,
|
|
],
|
|
// Macintosh Japanese
|
|
[
|
|
'CP932',
|
|
10001,
|
|
],
|
|
// Macintosh Chinese Traditional
|
|
[
|
|
'CP950',
|
|
10002,
|
|
],
|
|
// Macintosh Korean
|
|
[
|
|
'CP1361',
|
|
10003,
|
|
],
|
|
// Apple Arabic
|
|
[
|
|
'MACARABIC',
|
|
10004,
|
|
],
|
|
// Apple Hebrew
|
|
[
|
|
'MACHEBREW',
|
|
10005,
|
|
],
|
|
// Macintosh Greek
|
|
[
|
|
'MACGREEK',
|
|
10006,
|
|
],
|
|
// Macintosh Cyrillic
|
|
[
|
|
'MACCYRILLIC',
|
|
10007,
|
|
],
|
|
// Macintosh - Simplified Chinese (GB 2312)
|
|
[
|
|
'CP936',
|
|
10008,
|
|
],
|
|
// Macintosh Romania
|
|
[
|
|
'MACROMANIA',
|
|
10010,
|
|
],
|
|
// Macintosh Ukraine
|
|
[
|
|
'MACUKRAINE',
|
|
10017,
|
|
],
|
|
// Macintosh Thai
|
|
[
|
|
'MACTHAI',
|
|
10021,
|
|
],
|
|
// Macintosh Central Europe
|
|
[
|
|
'MACCENTRALEUROPE',
|
|
10029,
|
|
],
|
|
// Macintosh Icelandic
|
|
[
|
|
'MACICELAND',
|
|
10079,
|
|
],
|
|
// Macintosh Turkish
|
|
[
|
|
'MACTURKISH',
|
|
10081,
|
|
],
|
|
// Macintosh Croatian
|
|
[
|
|
'MACCROATIAN',
|
|
10082,
|
|
],
|
|
// UTF-16 (BIFF8) grandfathers erroneous libraries
|
|
[
|
|
'UTF-16LE',
|
|
21010,
|
|
],
|
|
// Apple Roman
|
|
[
|
|
'MAC',
|
|
32768,
|
|
],
|
|
// Unicode (UTF-7)
|
|
[
|
|
'UTF-7',
|
|
65000,
|
|
],
|
|
// Unicode (UTF-8)
|
|
[
|
|
'UTF-8',
|
|
65001,
|
|
],
|
|
];
|