summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2014-02-13 11:56:54 +0900
committerYasuo Ohgaki <yohgaki@php.net>2014-02-13 11:56:54 +0900
commit9a5cb51ebcb778b0cac39928fb6fcd5c604fe6cd (patch)
tree196bec3fad7cd0e8f2a26bc298b803d2383d0f58 /main/main.c
parentc9e9151bb3c5bc2e257a9e23d53b6f0234aac743 (diff)
parentcbd108abf19d9fb9ae1d4ccd153215f56a2763e8 (diff)
downloadphp-git-9a5cb51ebcb778b0cac39928fb6fcd5c604fe6cd.tar.gz
Merge branch 'PHP-5.6'
* PHP-5.6: Implement RFC https://wiki.php.net/rfc/default_encoding
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/main/main.c b/main/main.c
index ebb158ac7c..8bb7903187 100644
--- a/main/main.c
+++ b/main/main.c
@@ -417,6 +417,45 @@ static PHP_INI_DISP(display_errors_mode)
/* {{{ PHP_INI_MH
*/
+static PHP_INI_MH(OnUpdateInternalEncoding)
+{
+ if (new_value_length) {
+ OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ } else {
+ OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ }
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_INI_MH
+ */
+static PHP_INI_MH(OnUpdateInputEncoding)
+{
+ if (new_value_length) {
+ OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ } else {
+ OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ }
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_INI_MH
+ */
+static PHP_INI_MH(OnUpdateOutputEncoding)
+{
+ if (new_value_length) {
+ OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ } else {
+ OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ }
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_INI_MH
+ */
static PHP_INI_MH(OnUpdateErrorLog)
{
/* Only do the safemode/open_basedir check at runtime */
@@ -522,8 +561,11 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("auto_append_file", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, auto_append_file, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("auto_prepend_file", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, auto_prepend_file, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("doc_root", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, doc_root, php_core_globals, core_globals)
- STD_PHP_INI_ENTRY("default_charset", SAPI_DEFAULT_CHARSET, PHP_INI_ALL, OnUpdateString, default_charset, sapi_globals_struct,sapi_globals)
- STD_PHP_INI_ENTRY("default_mimetype", SAPI_DEFAULT_MIMETYPE, PHP_INI_ALL, OnUpdateString, default_mimetype, sapi_globals_struct,sapi_globals)
+ STD_PHP_INI_ENTRY("default_charset", PHP_DEFAULT_CHARSET, PHP_INI_ALL, OnUpdateString, default_charset, sapi_globals_struct, sapi_globals)
+ STD_PHP_INI_ENTRY("default_mimetype", SAPI_DEFAULT_MIMETYPE, PHP_INI_ALL, OnUpdateString, default_mimetype, sapi_globals_struct, sapi_globals)
+ STD_PHP_INI_ENTRY("internal_encoding", "", PHP_INI_ALL, OnUpdateInternalEncoding, internal_encoding, php_core_globals, core_globals)
+ STD_PHP_INI_ENTRY("input_encoding", "", PHP_INI_ALL, OnUpdateInputEncoding, input_encoding, php_core_globals, core_globals)
+ STD_PHP_INI_ENTRY("output_encoding", "", PHP_INI_ALL, OnUpdateOutputEncoding, output_encoding, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateErrorLog, error_log, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("extension_dir", PHP_EXTENSION_DIR, PHP_INI_SYSTEM, OnUpdateStringUnempty, extension_dir, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("sys_temp_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, sys_temp_dir, php_core_globals, core_globals)