I have a bunch of websites encoded in UTF-8. They contain accents and those weird n's with the squiggles over them and all kinds of fun stuff.

When I try and open them in any text editor, even Notepad++ with character encoding set to UTF-8, I get some weird characters.

In my browser :

enter image description here

In text-editor :

enter image description here

Could someone please explain what is going on here?


HTML uses following entities for letters and other characters used in foreign languages. Take a look and you will see that "ó" character is "ó".

And this is a good article about the UTF-8 and Character Encoding in browsers:

In the beginning, there was ASCII, and things were simple. But they weren't good, for no one could write in Cyrillic or Thai. So there exploded a proliferation of character encodings to remedy the problem by extending the characters ASCII could express. This ridiculously simplified version of the history of character encodings shows us that there are now many character encodings floating around.

A character encoding tells the computer how to interpret raw zeroes and ones into real characters. It usually does this by pairing numbers with characters.


The page has been written using entity references (old term) or named character references (HTML5 term), which are special notations for characters. In an UTF-8 encoded page, you could use e.g. “ó” as such, but a reference like ó is valid, too, and might be preferred by page authors/developers for various reasons (e.g., not knowing how to type “ó”). Quite often, the use of entities is just a holdover from old practices that were once necessary (in the 1990s) before widespread support to UTF-8 in browsers.

The notation ó is completely safe to use, though it makes HTML source code less readable. For example, if a user copies and pastes text, he gets “ó”, because ó exists in HTML source only; it is internally converted to “ó” by the HTML parser of a browser.

However, some references are unsafe. Generally, entities defined in HTML 4.01 are safe. (Some of them may refer to characters that are not always rendered correctly due to font problems, but such problems exist quite independently of the use of an entity versus the character itself.) There is a much larger set of named character references in HTML5, and old browser versions often lack support to the extensions.

For example, ō may or may not be supported. If supported, it is shown as “ō” (o with macron); if not supported (e.g. on IE 9 and older), it is rendered literally. It is thus much safer to use the character itself or the numeric referece ō.


When I try and open them in any text editor I get some weird characters


They are HTML Special Entity Codes.

ó is the special character representation for a "lower-case "o" with acute accent".

You can see the full list of HTML Special Entity Codes at HTML Codes Table.

HTML Entities and/or ISO Latin-1 codes can be placed in source code like any other alphanumeric characters to produce special characters and symbols that cannot be generated in HTML with normal keyboard commands.

For example, to render Düsseldorf the HTML source should read

Düsseldorf or Düsseldorf

Source HTML: Special Characters

  • Thank you very much for this explanation. Very helpful. So there is no bug here and this will display correctly in my HTML, I am just silly. Thanks :) – Simon Kiely Feb 6 '15 at 11:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.