note 37960 added to function.ob-iconv-handler

From: Date: Wed, 03 Dec 2003 14:10:58 +0000
Subject: note 37960 added to function.ob-iconv-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-61327@lists.php.net to get a copy of this message
hi it's not mentioned here in doc, but ob_iconv_handler() also sets Header('Content-Type') header, based on value of output_encoding. you might get because of this warning: PHP Warning: Cannot modify header information - headers already sent by (output started at ob.php:15) in ob.php on line 28 1:<? 2:/// 3:Header('Content-Type: text/html; charset=utf-8'); 4: 5:iconv_set_encoding('internal_encoding', 'iso8859-1'); 6:iconv_set_encoding('output_encoding', 'UTF-8'); 7: 8:ob_start('ob_iconv_handler'); 9: 10:// produce latin1 output 11:echo "üä<br>"; 12: 13: 14:// switch to utf8 encoding 15:ob_end_flush(); 16: 17:// produce utf8 output 18:echo "Pühapäev"; 19: 20:// switch back to latin1 21:ob_start('ob_iconv_handler'); 22: 23:// latin1 24:echo "ä<br>"; 25: 26: 27:// end buffering 28:ob_end_flush(); 29: 30:?> ---- Manual Page -- http://www.php.net/manual/en/function.ob-iconv-handler.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37960 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37960&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37960&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#61327) next »