@@ -12,25 +12,24 @@ $sjis = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==');
12
12
$ jis = base64_decode ('GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg== ' );
13
13
// EUC-JP string
14
14
$ euc_jp = "\xC6\xFC\xCB\xDC\xB8\xEC\xA5\xC6\xA5\xAD\xA5\xB9\xA5\xC8\xA4\xC7\xA4\xB9\xA1\xA301234 \xA3\xB5\xA3\xB6\xA3\xB7\xA3\xB8\xA3\xB9\xA1\xA3" ;
15
+ // UTF-8
16
+ $ polish1 = "Zażółć gęślą jaźń. " ;
17
+ $ polish2 = "Wół poszedł spać bardzo wcześnie. A to zdanie bez ogonka. " ;
15
18
16
19
echo "== BASIC TEST == \n" ;
17
20
18
21
print ("SJIS: " . mb_detect_encoding ($ sjis , 'SJIS ' ) . "\n" );
19
-
20
22
print ("JIS: " . mb_detect_encoding ($ jis , 'JIS ' ) . "\n" );
21
-
22
23
print ("EUC-JP: " . mb_detect_encoding ($ euc_jp , 'UTF-8,EUC-JP,JIS ' ) . "\n" );
23
-
24
24
print ("EUC-JP: " . mb_detect_encoding ($ euc_jp , 'JIS,EUC-JP ' ) . "\n" );
25
+ print ("UTF-8: " . mb_detect_encoding ($ polish1 , 'UTF-8,UTF-16,ISO-8859-1 ' ) . "\n" );
26
+ print ("UTF-8: " . mb_detect_encoding ($ polish2 , 'UTF-8,UTF-16,ISO-8859-1 ' ) . "\n" );
25
27
26
28
echo "== ARRAY ENCODING LIST == \n" ;
27
29
28
30
$ a = ['UTF-8 ' , 'EUC-JP ' , 'SJIS ' , 'JIS ' ];
29
-
30
31
print ("JIS: " . mb_detect_encoding ($ jis , $ a ) . "\n" );
31
-
32
32
print ("EUC-JP: " . mb_detect_encoding ($ euc_jp , $ a ) . "\n" );
33
-
34
33
print ("SJIS: " . mb_detect_encoding ($ sjis , $ a ) . "\n" );
35
34
36
35
$ test = "CHARSET=windows-1252:Do \xeb;John " ;
@@ -226,6 +225,8 @@ $deEncodings = [
226
225
];
227
226
test ($ deStrings , $ deEncodings );
228
227
228
+ test ([$ polish1 , $ polish2 ], ['UTF-32BE ' , 'UTF-32LE ' , 'UTF-16BE ' , 'UTF-16LE ' , 'UTF-8 ' , 'ISO-8859-2 ' ]);
229
+
229
230
echo "Done! \n" ;
230
231
231
232
?>
@@ -235,6 +236,8 @@ SJIS: SJIS
235
236
JIS: JIS
236
237
EUC-JP: EUC-JP
237
238
EUC-JP: EUC-JP
239
+ UTF-8: UTF-8
240
+ UTF-8: UTF-8
238
241
== ARRAY ENCODING LIST ==
239
242
JIS: JIS
240
243
EUC-JP: EUC-JP
0 commit comments