Determining "Actual encoding of the document" when IDE disagrees with UTF=8

In my HTML5 page, my charset meta is:
< meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”>

However, NetBeans IDE complains:
Internal encoding declaration “utf-8” disagrees with the actual encoding of the document (“windows-1252”).

I cannot see by visual inspection which elements on the page are not uft-8. How do I ferret them out?

This might help:
https://github.com/rogerjohansson/html5validator/issues/10

A browser can also tell you the encoding it thinks it’s being given, in the Page Info and in the Headers, and also if you have access to the server logs, they should be in the request info as well.

I’m assuming that there is a stray character in there that is not utf-8. I’d like to know which one it is so I can replace it. I doubt that a server log will point that out, thanks.

Seeing “windows-1252” makes me think you at one time used Word to edit the file.
IMHO Word may be great for print documents but should be completely avoided for code files.

My guess is there is a “curly” or “fancy” quotation mark in the file somewhere.

Also, check your text editor settings and make sure it’s UTF-8 - with no BOM

1 Like

I never use Word for coding; that’s what makes this “error” puzzling. AllanP’s link may give the answer.

AllenP’s link is indeed most likely to have an answer but it’s also good to know all different ways to check your documents.

one time in vim I got some winfile and I found a magic quote, copied it and searched for it… it was all over the place and I actually couldn’t see it in the document but could in the browser. Bleh, that sucked.

AllenP’s answer is that the error is simply wrong.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.