<< that keeps appearing before £

Associate
Joined
5 Sep 2007
Posts
316
This is probably very simple but I keep getting this symbol  appearing on me site before every pound symbol , such as £10.00. I can't see this in the code anywhere and it can only be seen when the page is previewed or uploaded.

Only started appearing after tiding up meta tags but I just can't find what I've done.
Any help grateful. The site is here http://www.wightnitro.com/
Bottom of page membership area.
 
It's down to incorrect character-encoding, or rather your webserver/IIS isn't indicating the encoding of your HTML documents. Browsers need to know what encoding you used when you wrote and saved the document in order to be able to display the text correctly.

Your pages appear to be written in UTF-8, but without any encoding information most browsers will fall back to ISO-8859-1, causing the character "£" to appear as "£". You probably removed the meta tag that contained your document's encoding:

Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Try adding it back in. If that doesn't help, you'll need to configure IIS to send appropriate content-type headers.
 
Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
That's great, all better now. Thanks for the quick replays:p
 
That is of course the more correct way of doing things, however, I've seen quite a few CMS's with DHTML WYSIWYG editors fail at that.

Which raises another mild annoyance of mine. I really do think that if people have a website, they should make some effort to learn to format the content they want to change. As much as I'm forced to implement those WYSIWYG editors, I really wish people would take responsibility for their sites.

fck has been pretty good from a validation point of view.
 
Which raises another mild annoyance of mine. I really do think that if people have a website, they should make some effort to learn to format the content they want to change. As much as I'm forced to implement those WYSIWYG editors, I really wish people would take responsibility for their sites.

fck has been pretty good from a validation point of view.

As far as I understood... just store the code in its purist form until final display, then run it through an html-ifier...
 
That is of course the more correct way of doing things, however, I've seen quite a few CMS's with DHTML WYSIWYG editors fail at that.
Since when is it more "correct" to use character entities over proper character encoding? If you can write a document in UTF-8, send it in UTF-8 and have it decoded as UTF-8, why would you knowingly chose to use a character entity instead of the proper character?
 
Since when is it more "correct" to use character entities over proper character encoding? If you can write a document in UTF-8, send it in UTF-8 and have it decoded as UTF-8, why would you knowingly chose to use a character entity instead of the proper character?

Entities are independent of coding.
 
Entities are independent of coding.
True, but that doesn't really provide any justification as to why they're the best choice against simply using the character itself?

Character entities assume the end user-agent a) understands what they are, and b) has some means of converting them to the equivalent character. This is safe-ish for HTML, but not so for XHTML. XML parsers are only required to understand a few character entities (like those for <, >, and &) and not the 'magic' ones like &pound;. However they are absolutely required to understand UTF-8 character encodings. Which would you prefer all your customers to see:

Code:
Available now for only £4.99
or
Code:
Available now for only &pound;4.99
?

Using character entities when they're not needed is simply code cruft (think of the extra bytes!), not forward-compatible and completely unnecessary when you can very easily ensure your character-encoding is correct.
 
XHTML specs are very limited on the number of character entities, namely ', &, <, and >. So whilst it might validate, it doesn't mean it's right.
 
I am having a similar problem on our works forum, using SMF for it and all the ' and £ signs appear as ?

No idea what is going on, spent ages going through all the settings etc but can't find anything about it.
 
Back
Top Bottom