BOF in the included file shows up in the browser

This is a discussion on BOF in the included file shows up in the browser within the PHP Language forums, part of the PHP Programming Forums category; I have an UTF-8 PHP file which generates HTML Then I cut the beginning of that file, pasted into ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-04-2004
aa
 
Posts: n/a
Default BOF in the included file shows up in the browser

I have an UTF-8 PHP file which generates HTML
Then I cut the beginning of that file, pasted into another UTF-8 file ind
included this second file into the first one.
After that the whole page moved down about one libe leaving a gap at the top
of the browser window.

Viewing the resulting code of the first file via VIEW-Source, I and see a
square inserted before the included file.
This does not show if I open the included file with a Unicode supporting
text editor. A non-unicode editos shows i>?
at the beginning of the file which, I understand, is BOF.
So the problem is that the browser sees the second BOF and displays it as a
small square in a separate line

How do I get round it?


Reply With Quote
  #2 (permalink)  
Old 10-06-2004
Chung Leong
 
Posts: n/a
Default Re: BOF in the included file shows up in the browser

"aa" <aa@virgin.net> wrote in message
news:41612549$0$92131$ed2619ec@ptn-nntp-reader03.plus.net...
> I have an UTF-8 PHP file which generates HTML
> Then I cut the beginning of that file, pasted into another UTF-8 file ind
> included this second file into the first one.
> After that the whole page moved down about one libe leaving a gap at the

top
> of the browser window.
>
> Viewing the resulting code of the first file via VIEW-Source, I and see a
> square inserted before the included file.
> This does not show if I open the included file with a Unicode supporting
> text editor. A non-unicode editos shows i>?
> at the beginning of the file which, I understand, is BOF.
> So the problem is that the browser sees the second BOF and displays it as

a
> small square in a separate line
>
> How do I get round it?
>


Storing PHP script as UTF-8 is a bad idea. The character at the beginning of
the file is zero width non-break space. Editors that support UTF-8
automatically insert it at the beginning of every file so that they can tell
the file is UTF-8 encoded when you re-open it.

Resave your scripts in ASCII and the problem will go away.


Reply With Quote
  #3 (permalink)  
Old 10-06-2004
aa
 
Posts: n/a
Default Re: BOF in the included file shows up in the browser

Thanks,

One thing worries me: I feel uncomfortable inserting ANSI file into a UTF
file - what would be the result?
Besides in the included file thwere are string literals in Cyrillics and
they get lost



"Chung Leong" <chernyshevsky@hotmail.com> wrote in message
news:moudnbOH65_fp_7cRVn-hw@comcast.com...
> "aa" <aa@virgin.net> wrote in message
> news:41612549$0$92131$ed2619ec@ptn-nntp-reader03.plus.net...
> > I have an UTF-8 PHP file which generates HTML
> > Then I cut the beginning of that file, pasted into another UTF-8 file

ind
> > included this second file into the first one.
> > After that the whole page moved down about one libe leaving a gap at the

> top
> > of the browser window.
> >
> > Viewing the resulting code of the first file via VIEW-Source, I and see

a
> > square inserted before the included file.
> > This does not show if I open the included file with a Unicode supporting
> > text editor. A non-unicode editos shows i>?
> > at the beginning of the file which, I understand, is BOF.
> > So the problem is that the browser sees the second BOF and displays it

as
> a
> > small square in a separate line
> >
> > How do I get round it?
> >

>
> Storing PHP script as UTF-8 is a bad idea. The character at the beginning

of
> the file is zero width non-break space. Editors that support UTF-8
> automatically insert it at the beginning of every file so that they can

tell
> the file is UTF-8 encoded when you re-open it.
>
> Resave your scripts in ASCII and the problem will go away.
>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:00 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0