Domanda

<span style="font-family:Symbol; font-size:10pt; color:#000000">&#212;</span><span style="font-family:MS Sans Serif; font-size:10pt; color:#000000">

Above is the HTML code for the trademark symbol that a fellow developer created. Unfortunately, they used this character sequence &#212 to create a trademark symbol for the program name. I'm under the impression this character sequence will most likely produce this character: Ô.

However, the sequence
- Shows up correctly in Chrome as a TM.
- Shows up INCORRECTLY in Safari as this symbol: Ô
- Shows up INCORRECTLY in Firefox as this symbol: Ô

Why does this symbol show up correctly in Google Chrome compared to the other browsers? I assume this has to do with how each parses different character sequences, but I'm just confused as to why Chrome would have it show up correctly and ignore the usual character sequence symbol Ô.

Question: Is this the best character sequence to use for a trademark symbol for use in HTML pages? Or are there other more common trademark symbol character sequences used?

Thanks!

EDIT: Found DOCTYPE at the top of one of the HTML pages, not sure if it will make a different or not.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
È stato utile?

Soluzione

Use the HTML entity &trade; (in a normal font instead of Symbol). This maps to &#8482;, but the named entity is widely supported.

Alternatively, use UTF-8 encoding for your HTML and embed the symbol directly, as suggested in the answers to this question.

Altri suggerimenti

The character reference &#212; unambiguously denotes the character “Ô” U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX. This does not depend on the doctype declaration or on the character encoding. Thus, browsers that display it as something else behave erroneously.

The use of the Symbol font is an old trick that relies on browser bugs. The Symbol font is a kludge where characters have been replaced by various symbols in a rather arbitrary way. The font contains two variants of the trademark symbol, a serif version in code position D4 (hex.) and a sans-serif version on code position E4. (The code tries to use the serif version in an apparently sans-serif environment.) It’s a really old trick, discussed and criticized well as early as in the 1990s in Alan Flavell’s Using FONT FACE to extend repertoire?

There are several alternative ways to present the correct character U+2122 TRADE MARK SIGN on a web page. No font trickery is needed, and the character should be rendered in the same font as the surrounding text; this happens automatically if you don’t do anything special.

The ways are:

  1. Writing the character itself (™). This is possible, using a decent editor, if the document encoding is UTF-8 or windows-1252, for example.
  2. Using the hexadecimal character reference &#x2122; or the decimal character reference &#8482;. These work independently of character encoding, but they make HTML source a bit cryptic.
  3. Using the entity reference &trade;. This is more mnemonic and works independently of character encoding. In theory, it is not safe in XHTML, though.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top