]> granicus.if.org Git - php/commitdiff
-Send charset US-ASCII or ini setting default_charset.
authorMarcus Boerger <helly@php.net>
Sun, 4 Aug 2002 22:49:48 +0000 (22:49 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 4 Aug 2002 22:49:48 +0000 (22:49 +0000)
#After some discussion with Ilia Alshanetsky
#But perhaps we should have a look for a mbstring solution...

ext/standard/info.c

index 5d90afc43e4ffc38b22b5518f1f1a381e762fa8b..ee22c9c9585f0ca47d07068c46652b999b01494a 100644 (file)
@@ -203,7 +203,7 @@ PHPAPI char *php_get_uname(char mode)
  */
 PHPAPI void php_print_info(int flag TSRMLS_DC)
 {
-       char **env, *tmp1, *tmp2;
+       char **env, *tmp1, *tmp2, *charset = NULL;
        char *php_uname;
        int expose_php = INI_INT("expose_php");
        time_t the_time;
@@ -216,7 +216,13 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
        PUTS("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n");
        PUTS("<head>");
        php_info_print_style();
-       PUTS("<title>phpinfo()</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"></head><body>");
+       if (SG(default_charset)) {
+               charset = SG(default_charset);
+       }
+       if (!charset || !charset[0]) {
+               charset = "US-ASCII";
+       }
+       php_printf("<title>phpinfo()</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\"></head><body>", charset);
 
        if (flag & PHP_INFO_GENERAL) {
                char *zend_version = get_zend_version();