3

Currently, I have my webpage set to Unicode/UTF-8. When trying to display a special character (for example, em dash, double arrow, etc), it shows up as a question mark symbol. I cannot change these characters to the HTML entity equivalent. How can I circumvent this issue?

3 Answers3

9

A question mark in a lozenge, �, indicates a character-level error: the data contains bytes that do no represent any character, according to the character encoding being applied. This typically happens when the document is declared as UTF-8 encoded but is really in iso-8859-1, windows-1252, or some similar encoding. Windows-1252 is a common default encoding used by various programs on Windows platforms. So you may need to open the file in your authoring program and re-save it as UTF-8 encoded.

If problems remain, please post the URL. Posting the code alone is not sufficient, since the character encoding is primarily specified in HTTP headers.

If you see a question mark in a small box, then it might be a font-level problem (lack of glyph in the fonts being used), but this would be very rare for common characters like the em dash. Different browsers have different ways of indicating character- or font-level problems.

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
  • Side note: depending on the font it might also be a white rectangle or a question mark in a rectangle. – Joey Jan 19 '12 at 07:33
7

Make sure your document is set to the correct character encoding in the actual code editor, as well as in the doctype. Both are necessary. I spent hours trying to tweak HTML when the only problem was that I needed to set the text setting in Coda.

<head>
    <meta charset="utf-8">

See the following screenshot:

enter image description here

HandiworkNYC.com
  • 10,914
  • 25
  • 92
  • 154
0

Make sure your characters are actually UTF-8 characters. They will probably look something like this:

&#174; or U+0020

http://www.kinsmancreative.com/transfer/char/index.php is a handy site for finding the decimal values of commonly used UTF-8 special characters if you need a reference.

Jesse Kinsman
  • 732
  • 2
  • 7
  • 20