Download src/php/php-src/ext/mbstring/tests/bug49536.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 780 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/mbstring/tests/bug49536.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/mbstring/tests/bug49536.phpt
-
curl -L -o bug49536.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/mbstring/tests/bug49536.phpt
780 Bytes
| --TEST-- | |
| Bug #49536 (mb_detect_encoding() returns incorrect results when strict_mode is turned on) | |
| --EXTENSIONS-- | |
| mbstring | |
| --FILE-- | |
| // non-strict mode | |
| var_dump(mb_detect_encoding("A\x81", "SJIS", false)); | |
| // strict mode | |
| var_dump(mb_detect_encoding("A\x81", "SJIS", true)); | |
| // non-strict mode | |
| var_dump(mb_detect_encoding("\xc0\x00", "UTF-8", false)); | |
| // strict mode | |
| var_dump(mb_detect_encoding("\xc0\x00", "UTF-8", true)); | |
| // Strict mode with multiple candidate encodings | |
| // This input string is invalid in ALL the candidate encodings: | |
| echo "== INVALID STRING - UTF-8 and SJIS ==\n"; | |
| var_dump(mb_detect_encoding("\xFF\xFF", ['SJIS', 'UTF-8'], true)); | |
| --EXPECT-- | |
| string(4) "SJIS" | |
| bool(false) | |
| string(5) "UTF-8" | |
| bool(false) | |
| == INVALID STRING - UTF-8 and SJIS == | |
| bool(false) | |