Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50421 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50397 invoked from network); 23 Nov 2010 09:34:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2010 09:34:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.185 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.185 il-mr1.zend.com Received: from [212.25.124.185] ([212.25.124.185:41968] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/2D-59959-EBA8BEC4 for ; Tue, 23 Nov 2010 04:34:56 -0500 Received: from il-gw1.zend.com (unknown [10.1.1.22]) by il-mr1.zend.com (Postfix) with ESMTP id 06D335050C; Tue, 23 Nov 2010 11:29:02 +0200 (IST) Received: from ws.home (10.1.10.20) by il-ex2.zend.net (10.1.1.22) with Microsoft SMTP Server id 14.0.689.0; Tue, 23 Nov 2010 11:34:40 +0200 Message-ID: <4CEB8AB9.4070909@zend.com> Date: Tue, 23 Nov 2010 12:34:49 +0300 User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: CC: Christopher Jones , Derick Rethans , Kalle Sommer Nielsen , Zeev Suraski , Andi Gutmans , Moriyoshi Koizumi References: <4CE537B0.1030607@zend.com> <4CE56978.9050102@oracle.com> <4CE686BC.4080307@zend.com> <4CEAECC2.6060403@oracle.com> In-Reply-To: <4CEAECC2.6060403@oracle.com> Content-Type: multipart/mixed; boundary="------------040809040804020202020104" Subject: Re: [PHP-DEV] --enable-zend-multibyte From: dmitry@zend.com (Dmitry Stogov) --------------040809040804020202020104 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit hi, I've prepared the patch which completely removes compile-time --enable-zend-multibyte configuration directive. The configuration can be changed at run-tume using zend.multibyte=0/1. The patch also fixes Unicode detection for phar archives. I would like to commit it on Thursday. Thanks. Dmitry. --------------040809040804020202020104 Content-Type: text/plain; name="mb.diff.txt" Content-Disposition: inline; filename="mb.diff.txt" Content-Transfer-Encoding: quoted-printable Index: ext/standard/info.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ext/standard/info.c (revision 305647) +++ ext/standard/info.c (working copy) @@ -759,11 +759,7 @@ =20 php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm(TSRMLS_C= ) ? "enabled" : "disabled" ); =20 -#ifdef ZEND_MULTIBYTE - php_info_print_table_row(2, "Zend Multibyte Support", "enabled"); -#else - php_info_print_table_row(2, "Zend Multibyte Support", "disabled"); -#endif + php_info_print_table_row(2, "Zend Multibyte Support", CG(multibyte) ? = "enabled" : "disabled"); =20 #if HAVE_IPV6 php_info_print_table_row(2, "IPv6 Support", "enabled" ); Index: ext/phar/tests/zip/notphar.phpt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ext/phar/tests/zip/notphar.phpt (revision 305647) +++ ext/phar/tests/zip/notphar.phpt (working copy) @@ -4,6 +4,7 @@ --INI-- phar.readonly=3D1 +detect_unicode=3D0 --FILE-- --EXPECTF-- -Fatal error: Encoding declaration pragma must be the very first statemen= t in the script in %s on line 3 +ok Index: ext/mbstring/tests/zend_multibyte-11.phpt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ext/mbstring/tests/zend_multibyte-11.phpt (revision 305647) +++ ext/mbstring/tests/zend_multibyte-11.phpt (working copy) @@ -11,7 +11,8 @@ --EXPECTF-- -Fatal error: Encoding declaration pragma must be the very first statemen= t in the script in %s on line 3 +ok Index: ext/mbstring/mbstring.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ext/mbstring/mbstring.c (revision 305647) +++ ext/mbstring/mbstring.c (working copy) @@ -77,9 +77,7 @@ #include "php_mbregex.h" #endif =20 -#ifdef ZEND_MULTIBYTE #include "zend_multibyte.h" -#endif /* ZEND_MULTIBYTE */ =20 #if HAVE_ONIG #include "php_onig_compat.h" @@ -98,12 +96,10 @@ static PHP_GINIT_FUNCTION(mbstring); static PHP_GSHUTDOWN_FUNCTION(mbstring); =20 -#ifdef ZEND_MULTIBYTE static size_t php_mb_oddlen(const unsigned char *string, size_t length, = const char *encoding TSRMLS_DC); static int php_mb_encoding_converter(unsigned char **to, size_t *to_leng= th, const unsigned char *from, size_t from_length, const char *encoding_t= o, const char *encoding_from TSRMLS_DC); static char* php_mb_encoding_detector(const unsigned char *arg_string, s= ize_t arg_length, char *arg_list TSRMLS_DC); static int php_mb_set_zend_encoding(TSRMLS_D); -#endif /* }}} */ =20 /* {{{ php_mb_default_identify_list */ @@ -1126,12 +1122,14 @@ } /* }}} */ =20 -#ifdef ZEND_MULTIBYTE /* {{{ static PHP_INI_MH(OnUpdate_mbstring_script_encoding) */ static PHP_INI_MH(OnUpdate_mbstring_script_encoding) { int *list, size; =20 + if (!CG(multibyte)) { + return FAILURE; + } if (php_mb_parse_encoding_list(new_value, new_value_length, &list, &siz= e, 1 TSRMLS_CC)) { if (MBSTRG(script_encoding_list) !=3D NULL) { free(MBSTRG(script_encoding_list)); @@ -1150,7 +1148,6 @@ return SUCCESS; } /* }}} */ -#endif /* ZEND_MULTIBYTE */ =20 /* {{{ static PHP_INI_MH(OnUpdate_mbstring_substitute_character) */ static PHP_INI_MH(OnUpdate_mbstring_substitute_character) @@ -1249,9 +1246,7 @@ PHP_INI_ENTRY("mbstring.http_input", "pass", PHP_INI_ALL, OnUpdate_mbst= ring_http_input) PHP_INI_ENTRY("mbstring.http_output", "pass", PHP_INI_ALL, OnUpdate_mbs= tring_http_output) STD_PHP_INI_ENTRY("mbstring.internal_encoding", NULL, PHP_INI_ALL, OnUp= date_mbstring_internal_encoding, internal_encoding_name, zend_mbstring_gl= obals, mbstring_globals) -#ifdef ZEND_MULTIBYTE PHP_INI_ENTRY("mbstring.script_encoding", NULL, PHP_INI_ALL, OnUpdate_m= bstring_script_encoding) -#endif /* ZEND_MULTIBYTE */ PHP_INI_ENTRY("mbstring.substitute_character", NULL, PHP_INI_ALL, OnUpd= ate_mbstring_substitute_character) STD_PHP_INI_ENTRY("mbstring.func_overload", "0",=20 PHP_INI_SYSTEM, OnUpdateLong, func_overload, zend_mbstring_globals, mbs= tring_globals) @@ -1278,10 +1273,8 @@ mbstring_globals->language =3D mbfl_no_language_uni; mbstring_globals->internal_encoding =3D mbfl_no_encoding_invalid; mbstring_globals->current_internal_encoding =3D mbstring_globals->inter= nal_encoding; -#ifdef ZEND_MULTIBYTE mbstring_globals->script_encoding_list =3D NULL; mbstring_globals->script_encoding_list_size =3D 0; -#endif /* ZEND_MULTIBYTE */ mbstring_globals->http_output_encoding =3D mbfl_no_encoding_pass; mbstring_globals->current_http_output_encoding =3D mbfl_no_encoding_pas= s; mbstring_globals->http_input_identify =3D mbfl_no_encoding_invalid; @@ -1319,11 +1312,9 @@ if (mbstring_globals->http_input_list) { free(mbstring_globals->http_input_list); } -#ifdef ZEND_MULTIBYTE if (mbstring_globals->script_encoding_list) { free(mbstring_globals->script_encoding_list); } -#endif /* ZEND_MULTIBYTE */ if (mbstring_globals->detect_order_list) { free(mbstring_globals->detect_order_list); } @@ -1441,10 +1432,10 @@ #if HAVE_MBREGEX PHP_RINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU); #endif -#ifdef ZEND_MULTIBYTE - zend_multibyte_set_internal_encoding(mbfl_no_encoding2name(MBSTRG(inter= nal_encoding)) TSRMLS_CC); - php_mb_set_zend_encoding(TSRMLS_C); -#endif /* ZEND_MULTIBYTE */ + if (CG(multibyte)) { + zend_multibyte_set_internal_encoding(mbfl_no_encoding2name(MBSTRG(inte= rnal_encoding)) TSRMLS_CC); + php_mb_set_zend_encoding(TSRMLS_C); + } =20 return SUCCESS; } @@ -1568,12 +1559,10 @@ RETURN_FALSE; } else { MBSTRG(current_internal_encoding) =3D no_encoding; -#ifdef ZEND_MULTIBYTE /* TODO: make independent from mbstring.encoding_translation? */ - if (MBSTRG(encoding_translation)) { + if (CG(multibyte) && MBSTRG(encoding_translation)) { zend_multibyte_set_internal_encoding(name TSRMLS_CC); } -#endif /* ZEND_MULTIBYTE */ RETURN_TRUE; } } @@ -4116,9 +4105,7 @@ zval *row1, *row2; const mbfl_language *lang =3D mbfl_no2language(MBSTRG(language)); enum mbfl_no_encoding *entry; -#ifdef ZEND_MULTIBYTE zval *row3; -#endif /* ZEND_MULTIBYTE */ =20 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &typ, &typ_l= en) =3D=3D FAILURE) { RETURN_FALSE; @@ -4201,22 +4188,22 @@ } else { add_assoc_string(return_value, "strict_detection", "Off", 1); } -#ifdef ZEND_MULTIBYTE - entry =3D MBSTRG(script_encoding_list); - n =3D MBSTRG(script_encoding_list_size); - if(n > 0) { - MAKE_STD_ZVAL(row3); - array_init(row3); - while (n > 0) { - if ((name =3D (char *)mbfl_no_encoding2name(*entry)) !=3D NULL) { - add_next_index_string(row3, name, 1); + if (CG(multibyte)) { + entry =3D MBSTRG(script_encoding_list); + n =3D MBSTRG(script_encoding_list_size); + if(n > 0) { + MAKE_STD_ZVAL(row3); + array_init(row3); + while (n > 0) { + if ((name =3D (char *)mbfl_no_encoding2name(*entry)) !=3D NULL) { + add_next_index_string(row3, name, 1); + } + entry++; + n--; } - entry++; - n--; + add_assoc_zval(return_value, "script_encoding", row3); } - add_assoc_zval(return_value, "script_encoding", row3); } -#endif /* ZEND_MULTIBYTE */ } else if (!strcasecmp("internal_encoding", typ)) { if ((name =3D (char *)mbfl_no_encoding2name(MBSTRG(current_internal_en= coding))) !=3D NULL) { RETVAL_STRING(name, 1); @@ -4303,8 +4290,7 @@ RETVAL_STRING("Off", 1); } } else { -#ifdef ZEND_MULTIBYTE - if (!strcasecmp("script_encoding", typ)) { + if (CG(multibyte) && !strcasecmp("script_encoding", typ)) { entry =3D MBSTRG(script_encoding_list); n =3D MBSTRG(script_encoding_list_size); if(n > 0) { @@ -4320,7 +4306,6 @@ } return; } -#endif /* ZEND_MULTIBYTE */ RETURN_FALSE; } } @@ -4706,7 +4691,6 @@ } /* }}} */ =20 -#ifdef ZEND_MULTIBYTE /* {{{ php_mb_set_zend_encoding() */ static int php_mb_set_zend_encoding(TSRMLS_D) { @@ -4864,7 +4848,6 @@ return mbfl_oddlen(&mb_string); } /* }}} */ -#endif /* ZEND_MULTIBYTE */ =20 #endif /* HAVE_MBSTRING */ =20 Index: ext/mbstring/mbstring.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ext/mbstring/mbstring.h (revision 305647) +++ ext/mbstring/mbstring.h (working copy) @@ -167,10 +167,8 @@ enum mbfl_no_language language; enum mbfl_no_encoding internal_encoding; enum mbfl_no_encoding current_internal_encoding; -#ifdef ZEND_MULTIBYTE enum mbfl_no_encoding *script_encoding_list; int script_encoding_list_size; -#endif /* ZEND_MULTIBYTE */ enum mbfl_no_encoding http_output_encoding; enum mbfl_no_encoding current_http_output_encoding; enum mbfl_no_encoding http_input_identify; Index: Zend/zend.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/zend.c (revision 305647) +++ Zend/zend.c (working copy) @@ -92,9 +92,8 @@ ZEND_INI_BEGIN() ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErro= rReporting) STD_ZEND_INI_BOOLEAN("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateG= CEnabled, gc_enabled, zend_gc_globals, gc_globals) -#ifdef ZEND_MULTIBYTE + STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateB= ool, multibyte, zend_compiler_globals, compiler_globals) STD_ZEND_INI_BOOLEAN("detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool= , detect_unicode, zend_compiler_globals, compiler_globals) -#endif ZEND_INI_END() =20 =20 Index: Zend/Zend.m4 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/Zend.m4 (revision 305647) +++ Zend/Zend.m4 (working copy) @@ -176,13 +176,6 @@ ZEND_INLINE_OPTIMIZATION=3Dyes ]) =20 -AC_ARG_ENABLE(zend-multibyte, -[ --enable-zend-multibyte Compile with zend multibyte support], [ - ZEND_MULTIBYTE=3D$enableval -],[ - ZEND_MULTIBYTE=3Dno -]) - AC_MSG_CHECKING([virtual machine dispatch method]) AC_MSG_RESULT($PHP_ZEND_VM) =20 @@ -195,9 +188,6 @@ AC_MSG_CHECKING(whether to enable Zend debugging) AC_MSG_RESULT($ZEND_DEBUG) =20 -AC_MSG_CHECKING(whether to enable Zend multibyte) -AC_MSG_RESULT($ZEND_MULTIBYTE) - case $PHP_ZEND_VM in SWITCH) AC_DEFINE(ZEND_VM_KIND,ZEND_VM_KIND_SWITCH,[virtual machine dispatch= method]) @@ -232,10 +222,6 @@ LIBZEND_CPLUSPLUS_CHECKS fi =20 =20 -if test "$ZEND_MULTIBYTE" =3D "yes"; then - AC_DEFINE(ZEND_MULTIBYTE, 1, [ ]) -fi - changequote({,}) if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" !=3D "yes"; then INLINE_CFLAGS=3D`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9s]*//` Index: Zend/zend_language_scanner.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/zend_language_scanner.h (revision 305647) +++ Zend/zend_language_scanner.h (working copy) @@ -36,7 +36,6 @@ uint lineno; char *filename; =20 -#ifdef ZEND_MULTIBYTE /* original (unfiltered) script */ unsigned char *script_org; size_t script_org_size; @@ -50,7 +49,6 @@ zend_encoding_filter output_filter; zend_encoding *script_encoding; zend_encoding *internal_encoding; -#endif /* ZEND_MULTIBYTE */ } zend_lex_state; =20 =20 Index: Zend/zend_language_scanner.l =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/zend_language_scanner.l (revision 305647) +++ Zend/zend_language_scanner.l (working copy) @@ -181,16 +181,16 @@ lex_state->filename =3D zend_get_compiled_filename(TSRMLS_C); lex_state->lineno =3D CG(zend_lineno); =20 -#ifdef ZEND_MULTIBYTE - lex_state->script_org =3D SCNG(script_org); - lex_state->script_org_size =3D SCNG(script_org_size); - lex_state->script_filtered =3D SCNG(script_filtered); - lex_state->script_filtered_size =3D SCNG(script_filtered_size); - lex_state->input_filter =3D SCNG(input_filter); - lex_state->output_filter =3D SCNG(output_filter); - lex_state->script_encoding =3D SCNG(script_encoding); - lex_state->internal_encoding =3D SCNG(internal_encoding); -#endif /* ZEND_MULTIBYTE */ + if (CG(multibyte)) { + lex_state->script_org =3D SCNG(script_org); + lex_state->script_org_size =3D SCNG(script_org_size); + lex_state->script_filtered =3D SCNG(script_filtered); + lex_state->script_filtered_size =3D SCNG(script_filtered_size); + lex_state->input_filter =3D SCNG(input_filter); + lex_state->output_filter =3D SCNG(output_filter); + lex_state->script_encoding =3D SCNG(script_encoding); + lex_state->internal_encoding =3D SCNG(internal_encoding); + } } =20 ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRML= S_DC) @@ -209,24 +209,24 @@ YYSETCONDITION(lex_state->yy_state); CG(zend_lineno) =3D lex_state->lineno; zend_restore_compiled_filename(lex_state->filename TSRMLS_CC); -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) =3D NULL; + if (CG(multibyte)) { + if (SCNG(script_org)) { + efree(SCNG(script_org)); + SCNG(script_org) =3D NULL; + } + if (SCNG(script_filtered)) { + efree(SCNG(script_filtered)); + SCNG(script_filtered) =3D NULL; + } + SCNG(script_org) =3D lex_state->script_org; + SCNG(script_org_size) =3D lex_state->script_org_size; + SCNG(script_filtered) =3D lex_state->script_filtered; + SCNG(script_filtered_size) =3D lex_state->script_filtered_size; + SCNG(input_filter) =3D lex_state->input_filter; + SCNG(output_filter) =3D lex_state->output_filter; + SCNG(script_encoding) =3D lex_state->script_encoding; + SCNG(internal_encoding) =3D lex_state->internal_encoding; } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) =3D NULL; - } - SCNG(script_org) =3D lex_state->script_org; - SCNG(script_org_size) =3D lex_state->script_org_size; - SCNG(script_filtered) =3D lex_state->script_filtered; - SCNG(script_filtered_size) =3D lex_state->script_filtered_size; - SCNG(input_filter) =3D lex_state->input_filter; - SCNG(output_filter) =3D lex_state->output_filter; - SCNG(script_encoding) =3D lex_state->script_encoding; - SCNG(internal_encoding) =3D lex_state->internal_encoding; -#endif /* ZEND_MULTIBYTE */ } =20 ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSR= MLS_DC) @@ -269,32 +269,33 @@ SCNG(yy_start) =3D NULL; =20 if (size !=3D -1) { -#ifdef ZEND_MULTIBYTE - if (zend_multibyte_read_script((unsigned char *)buf, size TSRMLS_CC) != =3D 0) { - return FAILURE; - } + if (CG(multibyte)) { + if (zend_multibyte_read_script((unsigned char *)buf, size TSRMLS_CC) = !=3D 0) { + return FAILURE; + } =20 - SCNG(yy_in) =3D NULL; + SCNG(yy_in) =3D NULL; =20 - zend_multibyte_set_filter(NULL TSRMLS_CC); + zend_multibyte_set_filter(NULL TSRMLS_CC); =20 - if (!SCNG(input_filter)) { - SCNG(script_filtered) =3D (unsigned char*)emalloc(SCNG(script_org_siz= e)+1); - memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)= +1); - SCNG(script_filtered_size) =3D SCNG(script_org_size); - } else { - SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size= ), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC); - if (SCNG(script_filtered) =3D=3D NULL) { - zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script f= rom the detected " - "encoding \"%s\" to a compatible encoding", LANG_SCNG(script_encod= ing)->name); + if (!SCNG(input_filter)) { + SCNG(script_filtered) =3D (unsigned char*)emalloc(SCNG(script_org_si= ze)+1); + memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size= )+1); +// SCNG(script_filtered)[SCNG(script_org_size)+1] =3D 0; + SCNG(script_filtered_size) =3D SCNG(script_org_size); + } else { + SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_siz= e), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC); + if (SCNG(script_filtered) =3D=3D NULL) { + zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script = from the detected " + "encoding \"%s\" to a compatible encoding", LANG_SCNG(script_enco= ding)->name); + } } + SCNG(yy_start) =3D SCNG(script_filtered) - offset; + yy_scan_buffer((char *)SCNG(script_filtered), SCNG(script_filtered_si= ze) TSRMLS_CC); + } else { + SCNG(yy_start) =3D buf - offset; + yy_scan_buffer(buf, size TSRMLS_CC); } - SCNG(yy_start) =3D SCNG(script_filtered) - offset; - yy_scan_buffer((char *)SCNG(script_filtered), SCNG(script_filtered_siz= e) TSRMLS_CC); -#else /* !ZEND_MULTIBYTE */ - SCNG(yy_start) =3D buf - offset; - yy_scan_buffer(buf, size TSRMLS_CC); -#endif /* ZEND_MULTIBYTE */ } else { zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed"); } @@ -437,25 +438,25 @@ SCNG(yy_in)=3DNULL; SCNG(yy_start) =3D NULL; =20 -#ifdef ZEND_MULTIBYTE - SCNG(script_org) =3D (unsigned char *)estrdup(str->value.str.val); - SCNG(script_org_size) =3D str->value.str.len; + if (CG(multibyte)) { + SCNG(script_org) =3D (unsigned char *)estrdup(str->value.str.val); + SCNG(script_org_size) =3D str->value.str.len; =20 - zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC); + zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC); =20 - if (!SCNG(input_filter)) { - SCNG(script_filtered) =3D (unsigned char*)emalloc(SCNG(script_org_size= )+1); - memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+= 1); - SCNG(script_filtered_size) =3D SCNG(script_org_size); + if (!SCNG(input_filter)) { + SCNG(script_filtered) =3D (unsigned char*)emalloc(SCNG(script_org_siz= e)+1); + memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)= +1); + SCNG(script_filtered_size) =3D SCNG(script_org_size); + } else { + SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size= ), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC); + } + + yy_scan_buffer((char *)SCNG(script_filtered), SCNG(script_filtered_siz= e) TSRMLS_CC);=09 } else { - SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size)= , SCNG(script_org), SCNG(script_org_size) TSRMLS_CC); + yy_scan_buffer(str->value.str.val, str->value.str.len TSRMLS_CC); } =20 - yy_scan_buffer((char *)SCNG(script_filtered), SCNG(script_filtered_size= ) TSRMLS_CC);=09 -#else /* !ZEND_MULTIBYTE */ - yy_scan_buffer(str->value.str.val, str->value.str.len TSRMLS_CC); -#endif /* ZEND_MULTIBYTE */ - zend_set_compiled_filename(filename TSRMLS_CC); CG(zend_lineno) =3D 1; CG(increment_lineno) =3D 0; @@ -466,7 +467,6 @@ ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D) { size_t offset =3D SCNG(yy_cursor) - SCNG(yy_start); -#ifdef ZEND_MULTIBYTE if (SCNG(input_filter)) { size_t original_offset =3D offset, length =3D 0; do { unsigned char *p =3D NULL; @@ -482,7 +482,6 @@ } } while (original_offset !=3D length); } -#endif return offset; } =20 @@ -524,7 +523,6 @@ BEGIN(ST_IN_SCRIPTING); compiler_result =3D zendparse(TSRMLS_C); =20 -#ifdef ZEND_MULTIBYTE if (SCNG(script_org)) { efree(SCNG(script_org)); SCNG(script_org) =3D NULL; @@ -533,7 +531,6 @@ efree(SCNG(script_filtered)); SCNG(script_filtered) =3D NULL; } -#endif /* ZEND_MULTIBYTE */ =20 if (compiler_result=3D=3D1) { CG(active_op_array) =3D original_active_op_array; @@ -571,7 +568,6 @@ return FAILURE; } zend_highlight(syntax_highlighter_ini TSRMLS_CC); -#ifdef ZEND_MULTIBYTE if (SCNG(script_org)) { efree(SCNG(script_org)); SCNG(script_org) =3D NULL; @@ -580,7 +576,6 @@ efree(SCNG(script_filtered)); SCNG(script_filtered) =3D NULL; } -#endif /* ZEND_MULTIBYTE */ zend_destroy_file_handle(&file_handle TSRMLS_CC); zend_restore_lexical_state(&original_lex_state TSRMLS_CC); return SUCCESS; @@ -600,7 +595,6 @@ } BEGIN(INITIAL); zend_highlight(syntax_highlighter_ini TSRMLS_CC); -#ifdef ZEND_MULTIBYTE if (SCNG(script_org)) { efree(SCNG(script_org)); SCNG(script_org) =3D NULL; @@ -609,16 +603,11 @@ efree(SCNG(script_filtered)); SCNG(script_filtered) =3D NULL; } -#endif /* ZEND_MULTIBYTE */ zend_restore_lexical_state(&original_lex_state TSRMLS_CC); zval_dtor(str); return SUCCESS; } -END_EXTERN_C() =20 -#ifdef ZEND_MULTIBYTE - -BEGIN_EXTERN_C() ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_inpu= t_filter, zend_encoding *old_encoding TSRMLS_DC) { size_t original_offset, offset, free_flag, new_len, length; @@ -728,11 +717,6 @@ zendlval->value.str.val =3D (char *) estrndup(yytext, yyleng); \ zendlval->value.str.len =3D yyleng; \ } -#else /* ZEND_MULTIBYTE */ -# define zend_copy_value(zendlval, yytext, yyleng) \ - zendlval->value.str.val =3D (char *)estrndup(yytext, yyleng); \ - zendlval->value.str.len =3D yyleng; -#endif /* ZEND_MULTIBYTE */ =20 static void zend_scan_escape_string(zval *zendlval, char *str, int len, = char quote_type TSRMLS_DC) { @@ -836,7 +820,6 @@ s++; } *t =3D 0; -#ifdef ZEND_MULTIBYTE if (SCNG(output_filter)) { size_t sz =3D 0; s =3D zendlval->value.str.val; @@ -844,7 +827,6 @@ zendlval->value.str.len =3D sz; efree(s); } -#endif /* ZEND_MULTIBYTE */ } =20 =20 @@ -1690,7 +1672,6 @@ inline_html: yyleng =3D YYCURSOR - SCNG(yy_text); =20 -#ifdef ZEND_MULTIBYTE if (SCNG(output_filter)) { int readsize; size_t sz =3D 0; @@ -1703,10 +1684,6 @@ zendlval->value.str.val =3D (char *) estrndup(yytext, yyleng); zendlval->value.str.len =3D yyleng; } -#else /* !ZEND_MULTIBYTE */ - zendlval->value.str.val =3D (char *) estrndup(yytext, yyleng); - zendlval->value.str.len =3D yyleng; -#endif zendlval->type =3D IS_STRING; HANDLE_NEWLINES(yytext, yyleng); return T_INLINE_HTML; @@ -1913,7 +1890,6 @@ } *t =3D 0; =20 -#ifdef ZEND_MULTIBYTE if (SCNG(output_filter)) { size_t sz =3D 0; s =3D zendlval->value.str.val; @@ -1921,7 +1897,6 @@ zendlval->value.str.len =3D sz; efree(s); } -#endif /* ZEND_MULTIBYTE */ return T_CONSTANT_ENCAPSED_STRING; } =20 Index: Zend/zend_highlight.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/zend_highlight.c (revision 305647) +++ Zend/zend_highlight.c (working copy) @@ -57,8 +57,6 @@ ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC) { const char *ptr=3Ds, *end=3Ds+len; - -#ifdef ZEND_MULTIBYTE char *filtered; int filtered_len; =20 @@ -67,7 +65,6 @@ ptr =3D filtered; end =3D filtered + filtered_len; } -#endif /* ZEND_MULTIBYTE */ =20 while (ptr auto-detection */ - if (memchr(LANG_SCNG(script_org), 0, LANG_SCNG(script_org_size))) { + if ((pos1 =3D memchr(LANG_SCNG(script_org), 0, LANG_SCNG(script_org_siz= e)))) { + /* check if the NULL byte is after the __HALT_COMPILER */ + if (pos1 - LANG_SCNG(script_org) >=3D sizeof("__HALT_COMPILER")) { + pos2 =3D strstr(LANG_SCNG(script_org), "__HALT_COMPILER"); + if (pos2 && pos2 < pos1) { + return NULL; + } + } /* make best effort if BOM is missing */ return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_= SCNG(script_org_size) TSRMLS_CC); } @@ -1168,7 +1175,6 @@ =20 return NULL; } -#endif /* ZEND_MULTIBYTE */ =20 /* * Local variables: Index: Zend/zend_multibyte.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/zend_multibyte.h (revision 305647) +++ Zend/zend_multibyte.h (working copy) @@ -22,8 +22,6 @@ #ifndef ZEND_MULTIBYTE_H #define ZEND_MULTIBYTE_H =20 -#ifdef ZEND_MULTIBYTE - #define BOM_UTF32_BE "\x00\x00\xfe\xff" #define BOM_UTF32_LE "\xff\xfe\x00\x00" #define BOM_UTF16_BE "\xfe\xff" @@ -67,8 +65,6 @@ ZEND_API int zend_multibyte_read_script(unsigned char *buf, size_t n TSR= MLS_DC); END_EXTERN_C() =20 -#endif /* ZEND_MULTIBYTE */ - #endif /* ZEND_MULTIBYTE_H */ =20 /* Index: Zend/zend_compile.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/zend_compile.c (revision 305647) +++ Zend/zend_compile.c (working copy) @@ -27,10 +27,7 @@ #include "zend_API.h" #include "zend_exceptions.h" #include "tsrm_virtual_cwd.h" - -#ifdef ZEND_MULTIBYTE #include "zend_multibyte.h" -#endif /* ZEND_MULTIBYTE */ =20 #define CONSTANT_EX(op_array, op) \ (op_array)->literals[op].constant @@ -149,14 +146,12 @@ =20 /* NULL, name length, filename length, last accepting char position len= gth */ result->value.str.len =3D 1+name_length+strlen(filename)+char_pos_len; -#ifdef ZEND_MULTIBYTE + /* must be binary safe */ result->value.str.val =3D (char *) safe_emalloc(result->value.str.len,= 1, 1); result->value.str.val[0] =3D '\0'; sprintf(result->value.str.val+1, "%s%s%s", name, filename, char_pos_bu= f); -#else - zend_spprintf(&result->value.str.val, 0, "%c%s%s%s", '\0', name, filena= me, char_pos_buf); -#endif /* ZEND_MULTIBYTE */ + result->type =3D IS_STRING; Z_SET_REFCOUNT_P(result, 1); } @@ -202,7 +197,6 @@ init_compiler_declarables(TSRMLS_C); zend_stack_init(&CG(context_stack)); =20 -#ifdef ZEND_MULTIBYTE CG(script_encoding_list) =3D NULL; CG(script_encoding_list_size) =3D 0; CG(internal_encoding) =3D NULL; @@ -210,7 +204,6 @@ CG(encoding_converter) =3D NULL; CG(encoding_oddlen) =3D NULL; CG(encoding_declared) =3D 0; -#endif /* ZEND_MULTIBYTE */ } /* }}} */ =20 @@ -249,11 +242,9 @@ zend_llist_destroy(&CG(open_files)); zend_stack_destroy(&CG(context_stack)); =20 -#ifdef ZEND_MULTIBYTE if (CG(script_encoding_list)) { efree(CG(script_encoding_list)); } -#endif /* ZEND_MULTIBYTE */ } /* }}} */ =20 @@ -5835,11 +5826,7 @@ if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.const= ant.value.str.len, "ticks", sizeof("ticks")-1)) { convert_to_long(&val->u.constant); CG(declarables).ticks =3D val->u.constant; -#ifdef ZEND_MULTIBYTE } else if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->= u.constant.value.str.len, "encoding", sizeof("encoding")-1)) { - zend_encoding *new_encoding, *old_encoding; - zend_encoding_filter old_input_filter; - if ((Z_TYPE(val->u.constant) & IS_CONSTANT_TYPE_MASK) =3D=3D IS_CONSTA= NT) { zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding"); } @@ -5863,31 +5850,31 @@ zend_error(E_COMPILE_ERROR, "Encoding declaration pragma must be the= very first statement in the script"); } } - CG(encoding_declared) =3D 1; =20 - convert_to_string(&val->u.constant); - new_encoding =3D zend_multibyte_fetch_encoding(val->u.constant.value.s= tr.val); - if (!new_encoding) { - zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", val->u.con= stant.value.str.val); - } else { - old_input_filter =3D LANG_SCNG(input_filter); - old_encoding =3D LANG_SCNG(script_encoding); - zend_multibyte_set_filter(new_encoding TSRMLS_CC); + if (CG(multibyte)) { + zend_encoding *new_encoding, *old_encoding; + zend_encoding_filter old_input_filter; =20 - /* need to re-scan if input filter changed */ - if (old_input_filter !=3D LANG_SCNG(input_filter) || - ((old_input_filter =3D=3D zend_multibyte_script_encoding_filter) && - (new_encoding !=3D old_encoding))) { - zend_multibyte_yyinput_again(old_input_filter, old_encoding TSRMLS_C= C); + CG(encoding_declared) =3D 1; + + convert_to_string(&val->u.constant); + new_encoding =3D zend_multibyte_fetch_encoding(val->u.constant.value.= str.val); + if (!new_encoding) { + zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", val->u.co= nstant.value.str.val); + } else { + old_input_filter =3D LANG_SCNG(input_filter); + old_encoding =3D LANG_SCNG(script_encoding); + zend_multibyte_set_filter(new_encoding TSRMLS_CC); + + /* need to re-scan if input filter changed */ + if (old_input_filter !=3D LANG_SCNG(input_filter) || + ((old_input_filter =3D=3D zend_multibyte_script_encoding_filter) && + (new_encoding !=3D old_encoding))) { + zend_multibyte_yyinput_again(old_input_filter, old_encoding TSRMLS_= CC); + } } } - efree(val->u.constant.value.str.val); -#else /* !ZEND_MULTIBYTE */ - } else if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->= u.constant.value.str.len, "encoding", sizeof("encoding")-1)) { - /* Do not generate any kind of warning for encoding declares */ - /* zend_error(E_COMPILE_WARNING, "Declare encoding [%s] not supported"= , val->u.constant.value.str.val); */ zval_dtor(&val->u.constant); -#endif /* ZEND_MULTIBYTE */ } else { zend_error(E_COMPILE_WARNING, "Unsupported declare '%s'", var->u.const= ant.value.str.val); zval_dtor(&val->u.constant); Index: Zend/tests/multibyte/multibyte_encoding_002.phpt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/tests/multibyte/multibyte_encoding_002.phpt (revision 305647) +++ Zend/tests/multibyte/multibyte_encoding_002.phpt (working copy) @@ -10,6 +10,7 @@ } ?> --INI-- +zend.multibyte=3D1 mbstring.internal_encoding=3Diso-8859-1 --FILE-- =EF>=BF --INI-- +zend.multibyte=3D1 mbstring.internal_encoding=3Diso-8859-1 --FILE-- =FF=FE< @@ -18,5 +19,5 @@ =20 =20 --EXPECT-- -H - \ No newline at end of file +Hello World +=3D=3D=3DDONE=3D=3D=3D \ No newline at end of file Index: Zend/tests/multibyte/multibyte_encoding_004.phpt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/tests/multibyte/multibyte_encoding_004.phpt (revision 305647) +++ Zend/tests/multibyte/multibyte_encoding_004.phpt (working copy) @@ -10,6 +10,7 @@ } ?> --INI-- +zend.multibyte=3D1 mbstring.script_encoding=3DShift_JIS mbstring.internal_encoding=3DShift_JIS --FILE-- Index: Zend/tests/multibyte/multibyte_encoding_005.phpt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/tests/multibyte/multibyte_encoding_005.phpt (revision 305647) +++ Zend/tests/multibyte/multibyte_encoding_005.phpt (working copy) @@ -10,6 +10,7 @@ } ?> --INI-- +zend.multibyte=3D1 mbstring.encoding_translation =3D On mbstring.script_encoding=3DShift_JIS mbstring.internal_encoding=3DUTF-8 Index: Zend/tests/multibyte/multibyte_encoding_006.phpt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Cannot display: file marked as a binary type. svn:mime-type =3D application/octet-stream Index: Zend/tests/multibyte/multibyte_encoding_001.phpt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/tests/multibyte/multibyte_encoding_001.phpt (revision 305647) +++ Zend/tests/multibyte/multibyte_encoding_001.phpt (working copy) @@ -10,6 +10,7 @@ } ?> --INI-- +zend.multibyte=3D1 mbstring.internal_encoding=3DSJIS --FILE-- --FILE-- ---EXPECT-- -DONE +--EXPECTF-- +Fatal error: Cannot use constants as encoding in %sdeclare_001.php on li= ne 7 + Index: Zend/tests/declare_002.phpt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/tests/declare_002.phpt (revision 0) +++ Zend/tests/declare_002.phpt (revision 0) @@ -0,0 +1,28 @@ +--TEST-- +Testing declare statement with several type values +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: Unsupported encoding [%d] in %sdeclare_002.php on line 3 + +Warning: Unsupported encoding [%f] in %sdeclare_002.php on line 4 + +Warning: Unsupported encoding [] in %sdeclare_002.php on line 5 + +Fatal error: Cannot use constants as encoding in %sdeclare_002.php on li= ne 7 Index: Zend/zend_globals.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Zend/zend_globals.h (revision 305647) +++ Zend/zend_globals.h (working copy) @@ -35,10 +35,7 @@ #include "zend_objects_API.h" #include "zend_modules.h" #include "zend_float.h" - -#ifdef ZEND_MULTIBYTE #include "zend_multibyte.h" -#endif /* ZEND_MULTIBYTE */ =20 /* Define ZTS if you want a thread-safe Zend */ /*#undef ZTS*/ @@ -150,9 +147,9 @@ =20 HashTable interned_strings; =20 -#ifdef ZEND_MULTIBYTE zend_encoding **script_encoding_list; size_t script_encoding_list_size; + zend_bool multibyte; zend_bool detect_unicode; zend_bool encoding_declared; =20 @@ -162,7 +159,6 @@ zend_encoding_detector encoding_detector; zend_encoding_converter encoding_converter; zend_encoding_oddlen encoding_oddlen; -#endif /* ZEND_MULTIBYTE */ =20 #ifdef ZTS zval ***static_members_table; @@ -308,7 +304,6 @@ int yy_state; zend_stack state_stack; =09 -#ifdef ZEND_MULTIBYTE /* original (unfiltered) script */ unsigned char *script_org; size_t script_org_size; @@ -322,7 +317,6 @@ zend_encoding_filter output_filter; zend_encoding *script_encoding; zend_encoding *internal_encoding; -#endif /* ZEND_MULTIBYTE */ }; =20 #endif /* ZEND_GLOBALS_H */ Index: main/main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- main/main.c (revision 305647) +++ main/main.c (working copy) @@ -1980,11 +1980,6 @@ REGISTER_MAIN_LONG_CONSTANT("PHP_MAXPATHLEN", MAXPATHLEN, CONST_PERSIST= ENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("PHP_INT_MAX", LONG_MAX, CONST_PERSISTENT |= CONST_CS); REGISTER_MAIN_LONG_CONSTANT("PHP_INT_SIZE", sizeof(long), CONST_PERSIST= ENT | CONST_CS); -#ifdef ZEND_MULTIBYTE - REGISTER_MAIN_LONG_CONSTANT("ZEND_MULTIBYTE", 1, CONST_PERSISTENT | CON= ST_CS); -#else - REGISTER_MAIN_LONG_CONSTANT("ZEND_MULTIBYTE", 0, CONST_PERSISTENT | CON= ST_CS); -#endif =20 #ifdef PHP_WIN32 REGISTER_MAIN_LONG_CONSTANT("PHP_WINDOWS_VERSION_MAJOR", EG(window= s_version_info).dwMajorVersion, CONST_PERSISTENT | CONST_CS); Index: win32/build/config.w32 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- win32/build/config.w32 (revision 305647) +++ win32/build/config.w32 (working copy) @@ -377,12 +377,6 @@ ARG_ENABLE('fd-setsize', "Set maximum number of sockets for select(2)", = "256"); ADD_FLAG("CFLAGS", "/D FD_SETSIZE=3D" + parseInt(PHP_FD_SETSIZE)); =20 -ARG_ENABLE("zend-multibyte", "Enable Zend multibyte encoding support", "= no"); -if (PHP_ZEND_MULTIBYTE =3D=3D "yes") { - STDOUT.WriteLine("Enabling Zend multibyte encoding support"); - AC_DEFINE('ZEND_MULTIBYTE', 1); -} -=20 AC_DEFINE('HAVE_USLEEP', 1); AC_DEFINE('HAVE_STRCOLL', 1); =20 --------------040809040804020202020104--