From: Michael Wallner Date: Tue, 12 Dec 2006 19:25:47 +0000 (+0000) Subject: - utf8 CREDITS and php_info API X-Git-Tag: RELEASE_1_0_0RC1~704 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6abefa16a05b29a96572b9dcb97d960293272086;p=php - utf8 CREDITS and php_info API - unicode progress in info.c --- diff --git a/ext/posix/CREDITS b/ext/posix/CREDITS index c769635d91..b7d4e0cd5d 100644 --- a/ext/posix/CREDITS +++ b/ext/posix/CREDITS @@ -1,2 +1,2 @@ Posix -Kristian Köhntopp +Kristian Köhntopp diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 8906d3595a..92808b2568 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -23,8 +23,10 @@ #include "info.h" #include "SAPI.h" +/* NOTE: keep utf8 */ + #define CREDIT_LINE(module, authors) php_info_print_table_row(2, module, authors) -#define CREDIT_PUTS(s) php_output_write_western((s), strlen(s) TSRMLS_CC) +#define CREDIT_PUTS(s) php_output_write_utf8((s), strlen(s) TSRMLS_CC) /* {{{ php_print_credits */ diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h index 97fd3597f0..f8c50090ae 100644 --- a/ext/standard/credits_ext.h +++ b/ext/standard/credits_ext.h @@ -57,7 +57,7 @@ CREDIT_LINE("pcntl", "Jason Greene"); CREDIT_LINE("Perl Compatible Regexps", "Andrei Zmievski"); CREDIT_LINE("PHP Data Objects", "Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle, Ilia Alshanetsky"); CREDIT_LINE("PHP hash", "Sara Golemon, Rasmus Lerdorf, Stefan Esser, Michael Wallner"); -CREDIT_LINE("Posix", "Kristian Köhntopp"); +CREDIT_LINE("Posix", "Kristian Köhntopp"); CREDIT_LINE("PostgreSQL driver for PDO", "Edin Kadribasic, Ilia Alshanetsky"); CREDIT_LINE("PostgreSQL", "Jouni Ahto, Zeev Suraski, Yasuo Ohgaki, Chris Kings-Lynne"); CREDIT_LINE("Pspell", "Vlad Krupin"); diff --git a/ext/standard/info.c b/ext/standard/info.c index 0255e97904..3b77e25571 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -67,8 +67,8 @@ static int php_info_print_html_esc(const char *str, int len) char *new_str; TSRMLS_FETCH(); - new_str = php_escape_html_entities((char *) str, len, &new_len, 0, ENT_QUOTES, "iso-8859-1" TSRMLS_CC); - written = php_output_write_western(new_str, new_len TSRMLS_CC); + new_str = php_escape_html_entities((char *) str, len, &new_len, 0, ENT_QUOTES, "utf8" TSRMLS_CC); + written = php_output_write_utf8(new_str, new_len TSRMLS_CC); efree(new_str); return written; } @@ -76,17 +76,15 @@ static int php_info_print_html_esc(const char *str, int len) static int php_info_uprint_html_esc(const UChar *str, int len) { UErrorCode status = U_ZERO_ERROR; - char *new_str = NULL, *esc_str; - int new_len, esc_len, written; + char *new_str = NULL; + int new_len, written; TSRMLS_FETCH(); zend_unicode_to_string_ex(UG(utf8_conv), &new_str, &new_len, str, len, &status); if (U_FAILURE(status)) { return 0; } - - esc_str = php_escape_html_entities(new_str, new_len, &esc_len, 0, ENT_QUOTES, "utf8" TSRMLS_CC); - written = php_output_write_utf8(esc_str, esc_len TSRMLS_CC); + written = php_info_print_html_esc(new_str, new_len); efree(new_str); return written; } @@ -102,7 +100,7 @@ static int php_info_printf(const char *fmt, ...) len = vspprintf(&buf, 0, fmt, argv); va_end(argv); - written = php_output_write_western(buf, len TSRMLS_CC); + written = php_output_write_utf8(buf, len TSRMLS_CC); efree(buf); return written; } @@ -118,7 +116,7 @@ static void php_info_print_request_uri(TSRMLS_D) static int php_info_print(const char *str) { TSRMLS_FETCH(); - return php_output_write_western(str, strlen(str) TSRMLS_CC); + return php_output_write_utf8(str, strlen(str) TSRMLS_CC); } static int php_info_uprint(const UChar *str, int len) diff --git a/ext/standard/info.h b/ext/standard/info.h index 6be71cfe5b..ab89cc3a79 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -66,6 +66,7 @@ PHP_FUNCTION(php_egg_logo_guid); PHP_FUNCTION(php_sapi_name); PHP_FUNCTION(php_uname); PHP_FUNCTION(php_ini_scanned_files); +/* NOTE: use UTF-8 if you print anything non-ASCII */ PHPAPI char *php_info_html_esc(char *string TSRMLS_DC); PHPAPI void php_print_info_htmlhead(TSRMLS_D); PHPAPI void php_print_info(int flag TSRMLS_DC); diff --git a/unicode-progress.txt b/unicode-progress.txt index 7229efa816..5ccaa5c07e 100644 --- a/unicode-progress.txt +++ b/unicode-progress.txt @@ -568,6 +568,18 @@ ext/standard array_intersect_uassoc(), array_uintersect_uassoc() array_intersect_key(), array_intersect_ukey() + info.c + ------ + phpinfo() + phpversion() + phpcredits() + php_logo_guid() + php_real_logo_guid() + php_egg_logo_guid() + zend_logo_guid() + php_sapi_name() + php_uname() + php_ini_scanned_files() string.c --------