summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-08-05 19:00:09 +0000
committerMarcus Boerger <helly@php.net>2002-08-05 19:00:09 +0000
commit55f735a587b4be26420ac369b8dd8fd6453f7f93 (patch)
tree9bf61339d2e3d0ec08e42794bed90b482f233c98
parent6d21c9465da87324fe58549152674440fb20ba99 (diff)
downloadphp-git-55f735a587b4be26420ac369b8dd8fd6453f7f93.tar.gz
Correct carset if iconv is active
#Same solution would work for mbstring - but that must wait
-rw-r--r--ext/standard/info.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/standard/info.c b/ext/standard/info.c
index ee22c9c958..ebbb79394c 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -38,6 +38,14 @@
#include <sys/utsname.h>
#endif
+#ifdef PHP_ATOM_INC
+#include "php_have_iconv.h"
+#endif
+#if HAVE_ICONV
+#include "ext/iconv/php_iconv.h"
+ZEND_EXTERN_MODULE_GLOBALS(iconv)
+#endif
+
#define SECTION(name) PUTS("<h2 align=\"center\">" name "</h2>\n")
PHPAPI extern char *php_ini_opened_path;
@@ -203,12 +211,13 @@ PHPAPI char *php_get_uname(char mode)
*/
PHPAPI void php_print_info(int flag TSRMLS_DC)
{
- char **env, *tmp1, *tmp2, *charset = NULL;
+ char **env, *tmp1, *tmp2;
+ const char *charset = NULL;
char *php_uname;
int expose_php = INI_INT("expose_php");
time_t the_time;
struct tm *ta, tmbuf;
-
+
the_time = time(NULL);
ta = php_localtime_r(&the_time, &tmbuf);
@@ -219,6 +228,11 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if (SG(default_charset)) {
charset = SG(default_charset);
}
+#if HAVE_ICONV
+ if (php_ob_handler_used("ob_iconv_handler" TSRMLS_CC)) {
+ charset = ICONVG(output_encoding);
+ }
+#endif
if (!charset || !charset[0]) {
charset = "US-ASCII";
}