Files
oleibman 8729a68338 Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen (#2213)
* Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen

Fixes issue #549 and https://github.com/Maatwebsite/Laravel-Excel/issues/989 (which is the source of the new test file). Some systems accept MACCENTRALEUROPE as the name for the appropriate encoding, and some accept MAC-CENTRALEUROPE. I fortunately have access to at least one of each type, and have run the tests on each.

CodePage.php has an array of translations from codepage number to string. I now allow the value to itself be an array; if so, the code will test each in turn to see if it can be used in iconv. I did not go fishing for other similar problems. If such show up, they can be dealt with in the same manner as this one. I don't really expect others, since this is a problem not merely for Xls, but, even then, it applies only to BIFF5 and earlier.

I also moved XlsTest from Reader to Reader/Xls.

* Cache Successful Result For Future Use

Per suggestion from @MarkBaker
2021-07-12 03:02:47 +02:00

280 lines
3.8 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', 'MAC-CENTRALEUROPE'],
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,
],
// invalid
[
'exception',
99999,
],
];