Forum Moderators: open

Message Too Old, No Replies

HTMLTidy error with Doctype

         

dpinion

7:13 pm on Mar 14, 2008 (gmt 0)

10+ Year Member



Sorry if this is the wrong category. I couldn't really decide where this should go. When I try to run my page through HTMLTidy, I see the following error:

Warning: specified input encoding (iso-8859-1) does not match actual input encoding (utf-8)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Note the unusual characters before the doctype declaration. I have tried replacing everything with simply <html>, but I still receive the same error and the same characters continue to show up. Any suggestions on where to begin searching for the cause?

Thanks

Trace

7:37 pm on Mar 14, 2008 (gmt 0)

10+ Year Member



I think that was just discussed in another thread;

[webmasterworld.com...]

penders wrote;

As I understand it, the bom (as it appears in utf-8 files) is contained in the 1st 3 bytes of the file and merely identifies the file as being utf-8. It does nothing to the structure of the file, or says anything more about the structure. If the file has been saved as utf-8 it is utf-8 with or without the bom. Windows might interpret the bom OK, however, Linux / web browsers do not.

If it's not interpreted OK then you get some funny characters at the start of the file when it's displayed. On the web you inform the browser that the file is utf-8 by the Content-Type header, not by the bom.

dpinion

7:52 pm on Mar 14, 2008 (gmt 0)

10+ Year Member



Thanks for that. I just came across that same thread while googling. I took a different approach and got it solved. I created a blank file in dreamweaver, copied everything from the offending file and pasted it in. When I went to save the new file, I made sure the checkmark was set as to NOT include the BOM signature.

Hopefully this will be helpful to someone in the future.