ID: 50167 Updated by: ras...@php.net Reported By: oliviapurvis at yahoo dot com -Status: Open +Status: Feedback Bug Type: Output Control Operating System: Centos 5.3 PHP Version: 5.3.0 New Comment:
Are you sure it isn't set by your Web server? Apache has a default charset setting as well. You should also be aware that it is extremely insecure to not set a charset on every response. IE will end up guessing and that guess can be forced to something like UTF7 by the user by entering text that looks like UTF7. That means that any input filtering you might have in place that assumes things are in iso-8859-1 or utf-8 will be completely ineffective. Previous Comments: ------------------------------------------------------------------------ [2009-11-13 16:00:35] oliviapurvis at yahoo dot com Description: ------------ According to the PHP manual: To disable sending of the charset, simply set default_charset to be empty. I set it to empty but the http header always output: Content-Type: text/html; charset=UTF-8 This inteferes with my html pages which has this html header: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> Only occurs with PHP 5.3. Works correctly with 5.2. By the way, if I set default_charset="iso-8859-1" it produces correctly: Content-Type: text/html; charset=iso-8859-1 But what I want is to disable charset completely. Reproduce code: --------------- <?php echo 'This is a test!'; exit; ?> Expected result: ---------------- Transfer-Encoding: chunked Content-Type: text/html 200 OK Actual result: -------------- Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 200 OK ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50167&edit=1