note 79801 added to function.utf8-decode
| From: | tacchete at gmail dot com | Date: | Thu, 13 Dec 2007 12:36:23 +0000 |
| Subject: | note 79801 added to function.utf8-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-133418@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-decode.php
Edit -- https://master.php.net/note/edit/79801
Del: integrated -- https://master.php.net/note/delete/79801/integrated
Del: useless -- https://master.php.net/note/delete/79801/useless
Del: bad code -- https://master.php.net/note/delete/79801/bad+code
Del: spam -- https://master.php.net/note/delete/79801/spam
Del: non-english -- https://master.php.net/note/delete/79801/non-english
Del: in docs -- https://master.php.net/note/delete/79801/in+docs
Del: other reasons-- https://master.php.net/note/delete/79801
Reject -- https://master.php.net/note/reject/79801
Search -- https://master.php.net/manage/user-notes.php