summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php4.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 /sapi/apache/mod_php4.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 'sapi/apache/mod_php4.c')
-rw-r--r--sapi/apache/mod_php4.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index d3ed4ef0bd..9c23523178 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -21,6 +21,10 @@
#include "php_apache_http.h"
+#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING)
+#include "ext/mbstring/mbstring.h"
+#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */
+
#undef shutdown
/* {{{ Prototypes
@@ -459,6 +463,11 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
fh.opened_path = NULL;
fh.free_filename = 0;
fh.type = ZEND_HANDLE_FILENAME;
+
+#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING)
+ php_mbstring_set_zend_encoding(TSRMLS_C);
+#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */
+
zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh);
return OK;
}