|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-04-13 09:01 UTC] ab@php.net
Description: ------------ Test diff: 002+ string(4) ",+TY" 003+ string(27) "?¢£¤¥" 002- string(28) "‚†™Ÿ" 003- string(32) "€¢£¤¥" Expected result: ---------------- test pass Actual result: -------------- test fail PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
Consider the following lines in ext\standard\html.c ========== BEGIN =========== ZVAL_STRING(&nm_mb_internal_encoding, "mb_internal_encoding", 0); if (call_user_function_ex(CG(function_table), NULL, &nm_mb_internal_encoding, &uf_result, 0, NULL, 1, NULL TSRMLS_CC) != FAILURE) { charset_hint = Z_STRVAL_P(uf_result); len = Z_STRLEN_P(uf_result); if (len == 4) { /* sizeof(none|auto|pass)-1 */ if (!memcmp("pass", charset_hint, sizeof("pass") - 1) || !memcmp("auto", charset_hint, sizeof("auto") - 1) || !memcmp("none", charset_hint, sizeof("none") - 1)) { charset_hint = NULL; len = 0; } } goto det_charset; } } #endif #endif charset_hint = SG(default_charset); if (charset_hint != NULL && (len=strlen(charset_hint)) != 0) { goto det_charset; } ========== END =========== As you can see, mbstring.internal_encoding having pass resets charset_hint and jumps to det_charset ommiting sapi globals check ... this results iso-8859-1 being choosed. This all happens only with mbstring compiled as shared. Fix follows.