@@ -25,6 +25,13 @@ print("Bad ASCII (strict): " . mb_detect_encoding("\xDD\x92", ['ASCII', 'UTF-8']
25
25
print ("Bad ASCII/UTF-8, with more errors for ASCII (non-strict): " . mb_detect_encoding ("\xD6\x8A\x8A" , ['ASCII ' , 'UTF-8 ' ], false ) . "\n" );
26
26
print ("Bad ASCII/UTF-8, with more errors for ASCII (strict): " . var_export (mb_detect_encoding ("\xD6\x8A\x8A" , ['ASCII ' , 'UTF-8 ' ], true ), true ) . "\n" );
27
27
28
+ print ("UTF-8 BOM (non-strict): " . mb_detect_encoding ("\xEF\xBB\xBF" , ["UTF-8 " , "ASCII " ], false ) . "\n" );
29
+ print ("UTF-8 BOM (strict): " . mb_detect_encoding ("\xEF\xBB\xBF" , ["UTF-8 " , "ASCII " ], true ) . "\n" );
30
+ print ("UTF-16BE BOM (non-strict): " . mb_detect_encoding ("\xFE\xFF" , ["UTF-8 " , "UTF-16BE " , "UTF-16LE " ], false ) . "\n" );
31
+ print ("UTF-16BE BOM (strict): " . mb_detect_encoding ("\xFE\xFF" , ["UTF-8 " , "UTF-16BE " , "UTF-16LE " ], true ) . "\n" );
32
+ print ("UTF-16LE BOM (non-strict): " . mb_detect_encoding ("\xFF\xFE" , ["UTF-8 " , "UTF-16BE " , "UTF-16LE " ], false ) . "\n" );
33
+ print ("UTF-16LE BOM (strict): " . mb_detect_encoding ("\xFF\xFE" , ["UTF-8 " , "UTF-16BE " , "UTF-16LE " ], true ) . "\n" );
34
+
28
35
print ("SJIS: " . mb_detect_encoding ($ sjis , 'SJIS ' , true ) . "\n" );
29
36
print ("JIS: " . mb_detect_encoding ($ jis , 'JIS ' , true ) . "\n" );
30
37
print ("EUC-JP (strict): " . mb_detect_encoding ($ euc_jp , 'UTF-8,EUC-JP,JIS ' , true ) . "\n" );
@@ -399,6 +406,12 @@ Bad ASCII (non-strict): UTF-8
399
406
Bad ASCII (strict): UTF-8
400
407
Bad ASCII/UTF-8, with more errors for ASCII (non-strict): UTF-8
401
408
Bad ASCII/UTF-8, with more errors for ASCII (strict): false
409
+ UTF-8 BOM (non-strict): UTF-8
410
+ UTF-8 BOM (strict): UTF-8
411
+ UTF-16BE BOM (non-strict): UTF-16BE
412
+ UTF-16BE BOM (strict): UTF-16BE
413
+ UTF-16LE BOM (non-strict): UTF-16LE
414
+ UTF-16LE BOM (strict): UTF-16LE
402
415
SJIS: SJIS
403
416
JIS: JIS
404
417
EUC-JP (strict): EUC-JP
0 commit comments