homepage Welcome to WebmasterWorld Guest from 54.197.147.90
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
sign not displaying correctly - any suggestions?
Gemini23




msg:4383640
 7:57 pm on Nov 4, 2011 (gmt 0)

There doubtless is a very simple answer to this...

but when I add a sign to Expression web html page off-line it looks fine.. but when preview and also load to the website - it then displays as £

Help?

 

Leosghost




msg:4383664
 9:06 pm on Nov 4, 2011 (gmt 0)

charset

use *£* in place of the sign..only use the part between the * and the *..not the *s themselves..

Using the wrong doctype can also give this kind of problem..

lucy24




msg:4383675
 9:36 pm on Nov 4, 2011 (gmt 0)

In the original question, you have utf-8 text being reinterpreted as latin-1. (I'd recognize that leading A-circumflex anywhere!)

Your html files must have a charset declaration, and it must match the character set you use to do the editing.

Some folks will tell you to use entities-- named or numerical-- for all non-ASCII characters. This is serious overkill. It makes your html unreadable, and makes it take up twice as much room (in bytes, disk space and bandwidth) as you go beyond the Latin-1 range. And it's obviously impossible if your base language uses a non-Roman script, so why do English web pages have to stay in the entity ghetto?

Gemini23




msg:4383689
 10:19 pm on Nov 4, 2011 (gmt 0)

Brilliant - thank you good people for an excellent solution! Fixed!

g1smd




msg:4383692
 10:29 pm on Nov 4, 2011 (gmt 0)

I recommend that you stop using a pound sign.

Use the GBP code. Google indexes that and savvy shoppers can use it to find sites with prices.

Gemini23




msg:4383695
 10:38 pm on Nov 4, 2011 (gmt 0)

what is the "GBP" Code? do you mean as GBP45.00

g1smd




msg:4383706
 10:55 pm on Nov 4, 2011 (gmt 0)

Search: [ISO 4217].


See also: [ISO 639], [ISO 3166], [ISO 8601]. These are basic building blocks of the internet.

penders




msg:4383787
 11:21 am on Nov 5, 2011 (gmt 0)

Leosghost: Using the wrong doctype can also give this kind of problem..


I don't see how an incorrect DOCTYPE can cause this? I thought this was a character encoding issue? Or can quirks mode trigger this?!

Some folks will tell you to use entities-- named or numerical-- for all non-ASCII characters. This is serious overkill. It makes your html unreadable, and makes it take up twice as much room (in bytes, disk space and bandwidth)...


...and if your overly HTML entity encoded content is pulled from a DB and intended to be searchable - it won't be.

Having said that, £ (the named HTML entity) is also defined in HTML4.

Leosghost




msg:4383788
 11:30 am on Nov 5, 2011 (gmt 0)

Or can quirks mode trigger this?!


Yes..I once spent 3 days "acquiring" the Teeshirt that lets me know this :(

Gemini23




msg:4383793
 12:26 pm on Nov 5, 2011 (gmt 0)

Great how such a 'simple' question can result in so much debate.... so which is best

1. GBP is okay but does it look ok? GDP25.00
does Google look for this more than the actual pound sign? 25.00

2. £ and £ both do the job but concensus on which is best?

:)

penders




msg:4383830
 3:56 pm on Nov 5, 2011 (gmt 0)

what is the "GBP" Code? do you mean as GBP45.00


1. GBP is okay but does it look ok? GDP25.00
does Google look for this more than the actual pound sign? 25.00


The ISO 4217 code ("GBP" for Great British Pound) should be separated from the amount by a space and appear before or after the amount depending on which countries standards you follow. The pound sign () is potentially ambiguous as there are several different currencies that use the pound, as there are with the dollar ($). The ISO code removes this ambiguity. However, whether it is really necessary to use the ISO code is really down to your target audience IMO (as with everything web). If you are running an international site dealing in multiple currencies then the ISO code might be necessary, however, if it's a UK only site then probably whatever is more acceptable to your users. TBH, I think most Brits expect to see the pound sign. All online shops I use, use the pound sign.

2. £ and £ both do the job but concensus on which is best?


Potentially £ will work on more (historic, non-standards compliant) browsers and £ should work on any standards compliant browser made in the last 14+ years?!

lucy24




msg:4383925
 11:04 pm on Nov 5, 2011 (gmt 0)

You forgot the third entity ;) £ The x means we are in hexadecimal rather than decimal encoding.

Named entities are an HTML 4 innovation. So to get a browser that couldn't recognize them you would probably have to have a browser that couldn't read HTML 4. Yes, there are rich conservative potential customers, but I think that's overdoing it :)

Interesting aside: My very oldest browser, MSIE 5.2 for Mac, will only display non-ASCII characters if they have HTML 4 named entities. You don't have to use the entity-- decimal or hexadecimal entities also work, as does the raw character if you change the encoding to UTF-8*-- but the character has to have an entity.


* That's another Very Old Browser issue: It can't read the "charset" declaration so you have to change the encoding manually. I don't know if there exist any newer browsers that lack this ability. I still include boilerplate about it in e-texts, and even on a few of my www pages that are specifically concerned with font display.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved