/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/mbstring/tests/bug49536.phpt
27 строк
780 B
Alex Dowad
Implement mb_detect_encoding using fast text conversion filters
03 янв 2023, 10:10
03 янв 2023, 10:10
0e7160b
Код
Авторство
О чём код?
--TEST-- Bug #49536 (mb_detect_encoding() returns incorrect results when strict_mode is turned on) --EXTENSIONS-- mbstring --FILE-- <?php // 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)