grucker Posted November 15, 2011 Report Share Posted November 15, 2011 I have a php site which validates on every page except one which carries a warning. The head is a php include so all pages have the same code. I realise this is not a problem but I would like an opinion as to why this may be happening. www. sites4eyes .co .uk is the site that validates and www. sites4eyes .co .uk/portfolio.php is the page that carries the warning. Quote Link to comment Share on other sites More sharing options...
Wickham Posted November 15, 2011 Report Share Posted November 15, 2011 The warning "Byte-Order Mark found in UTF-8 File" in www. sites4eyes .co .uk/portfolio.php is because it has been saved with the encoding utf-8 instead of encoding ANSI. I've just checked that it was saved like that by saving your php file and opening it in Notepad and then using Save As and looking at the encoding box in teh save window. Quote Link to comment Share on other sites More sharing options...
grucker Posted November 15, 2011 Author Report Share Posted November 15, 2011 Thanks for you input. So is the present coding supposed to be ansi? the coding does specify utf-8 but it is the same for all the pages and only this one gets the warning. That was what I needed an answer to but I will look into this ansi thingy. Quote Link to comment Share on other sites More sharing options...
Wickham Posted November 15, 2011 Report Share Posted November 15, 2011 It is usual to use encoding ANSI when saving any html or php file. The byte order mark can sometimes be seen at the very top left corner of the screen, it's a funny symbol that doesn't do any harm, but may lower everything by one row. Coding utf-8 should be done in the meta tag for charset, like:- <meta http-equiv="content-type" content="text/html; charset=utf-8"/> Quote Link to comment Share on other sites More sharing options...
grucker Posted November 15, 2011 Author Report Share Posted November 15, 2011 It is usual to use encoding ANSI when saving any html or php file. The byte order mark can sometimes be seen at the very top left corner of the screen, it's a funny symbol that doesn't do any harm, but may lower everything by one row. Coding utf-8 should be done in the meta tag for charset, like:- <meta http-equiv="content-type" content="text/html; charset=utf-8"/> I had better start again. The met tag is identical to the one you suggested. All pages on the site are identical except for the title in the head section. All pages except the portfolio page validate. The portfolio page validates with a warning. I just wondered why. Quote Link to comment Share on other sites More sharing options...
Wickham Posted November 16, 2011 Report Share Posted November 16, 2011 The reason for the warning "Byte-Order Mark found in UTF-8 File" is definitely because the second website www. sites4eyes .co .uk/portfolio.php has been saved with encoding utf-8 while the first www. sites4eyes .co .uk has been saved with encoding ANSI, I've checked both. It's nothing to do with the .php extension. When you save the file (using Notepad in my case), use Save As and you should see boxes for File name, Save as Type and also encoding, before the Save and Cancel buttons. Change to ANSI. Quote Link to comment Share on other sites More sharing options...
grucker Posted November 16, 2011 Author Report Share Posted November 16, 2011 The reason for the warning "Byte-Order Mark found in UTF-8 File" is definitely because the second website www. sites4eyes .co .uk/portfolio.php has been saved with encoding utf-8 while the first www. sites4eyes .co .uk has been saved with encoding ANSI, I've checked both. It's nothing to do with the .php extension. When you save the file (using Notepad in my case), use Save As and you should see boxes for File name, Save as Type and also encoding, before the Save and Cancel buttons. Change to ANSI. Thank you for your help. I use dreamweaver to edit files not notebook. I edited in notebook and followed your instruction but nothing changed. I suspect the browser didnt refresh. Then I noticed when saving this file in dream weaver the following box was ticked non of the other pages had this. Include unicode signature (BOM). I unticked this and saved. Still nothing changed so I deleted the file from the server and opened a new file and rewrote the code uploaded and everything is fine. Your advice has certainly made me check in future before I press save. Thanks again Quote Link to comment Share on other sites More sharing options...
Wickham Posted November 16, 2011 Report Share Posted November 16, 2011 Yes, that was the cause, BOM (Byte Order Mark). I don't really know what its purpose is, I just know to avoid it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.