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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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? |
|
|||
|
"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. |
|
|||
|
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. > > |