note 79800 added to function.utf8-encode

From: Date: Thu, 13 Dec 2007 12:35:38 +0000
Subject: note 79800 added to function.utf8-encode
Groups: php.notes 
Request: Send a blank email to php-notes+get-133417@lists.php.net to get a copy of this message
Known problem with Byte Order Mark (BOM) and header() in pages of a site. For example at sending headings or to a dynamic conclusion in other coding distinct from UTF-8 by means of XSLT (<xsl:output encoding="windows-1251"/>). To clean all symbols BOM from the text of page: 1. exclude BOM from the main file; 2. write down function of a return call for the buffer <?php header('content-type: text/html; charset: utf-8'); ob_start('ob'); function ob($buffer) { return str_replace("\xef\xbb\xbf", '', $buffer); } ?> it will exclude BOM from a code of the connected files; 3. do not experience for BOM in connected files; 4. be pleased. ---- Server IP: 195.54.192.44 Probable Submitter: 194.154.66.118 ---- Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php Edit -- https://master.php.net/note/edit/79800 Del: integrated -- https://master.php.net/note/delete/79800/integrated Del: useless -- https://master.php.net/note/delete/79800/useless Del: bad code -- https://master.php.net/note/delete/79800/bad+code Del: spam -- https://master.php.net/note/delete/79800/spam Del: non-english -- https://master.php.net/note/delete/79800/non-english Del: in docs -- https://master.php.net/note/delete/79800/in+docs Del: other reasons-- https://master.php.net/note/delete/79800 Reject -- https://master.php.net/note/reject/79800 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#133417) next »