File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / mbstring / tests / bug49536.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:40 2012 UTC (12 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, HEAD
php 5.4.3+patches

--TEST--
Bug #49536 (mb_detect_encoding() returns incorrect results when strict_mode is turned on)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--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));
?>
--EXPECT--
string(4) "SJIS"
bool(false)
bool(false)
bool(false)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>