Jump to content

Recommended Posts

Hello!

 

Prompt the decision of my problem.

I do a site, and I use sheaf XML + XSLT (all files in the coding utf-8), under Windows.

 

A problem: at the established coding of a conclusion in a xslt-pattern distinct from utf-8, for example windows-1251 I receive symbols BOM in a conclusion of the buffer.

 

To get rid of it to me function does not help:

 

ob_start ('ob');
function ob ($buffer) {
//kill byte order mark
$buffer = preg_replace ('@\xef\xbb\xbf@', ", $buffer);
return trim ($buffer);
}

 

It is very strange as if to check so:

 

$firstchar = substr ($buffer, 0, 1);

 

the first symbol will be ` <` - in my case it ` <! DOCTYPE ht... `, that is after work of a method transformToXML in a conclusion it is impossible to define presence BOM (and it there is)!

 

As the conclusion turns out in the coding windows-1251, and in the buffer remains BOM a browser breaks display, including what it to it has come utf-8.

 

It is inconvenient me manually delete BOM from files php as periodically I hands correct them in a notepade for windows.

Why it is not visible BOM in buffer?

Link to comment
https://forums.phpfreaks.com/topic/55082-bite-order-mark/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.