summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorRui Hirokawa <hirokawa@php.net>2002-05-08 12:33:44 +0000
committerRui Hirokawa <hirokawa@php.net>2002-05-08 12:33:44 +0000
commitf30b722f14521fbad2fabe5fdcaa2b60fe97eebb (patch)
tree0b386e8a7bcb10b5736b4d32500ccb34c0bc9ce7 /main/main.c
parent2b5beee5ad6947af588e4d5f7131f189b8c90391 (diff)
downloadphp-git-f30b722f14521fbad2fabe5fdcaa2b60fe97eebb.tar.gz
Added conversion support from script character encoding to internal character encoding. This feature is very useful for japanese who uses Shift_JIS encoding because some of characters in Shift_JIS are including '0x5c' and it causes some troubles on Zend parser. This patch is made by Masaki Fujimoto.
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c
index fcd73d8239..16b47b6cea 100644
--- a/main/main.c
+++ b/main/main.c
@@ -75,6 +75,10 @@
#include "php_logos.h"
#include "php_streams.h"
+#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING)
+#include "ext/mbstring/mbstring.h"
+#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */
+
#include "SAPI.h"
/* }}} */
@@ -1402,6 +1406,9 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
} else {
append_file_p = NULL;
}
+#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING)
+ php_mbstring_set_zend_encoding(TSRMLS_C);
+#endif /* ZEND_MULTIBYTE && HAVE_MBSTRING */
retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);
} zend_end_try();