£ Turns Into ? In HTML?

Discussion in 'HTML & Website Design' started by Dean_Saliba, Feb 22, 2008.

  1. #1
    Can anyone explain this to me?

    Recently I have noticed that when I put together web sites and I enter the pound sign £ into html code it comes up as a question mark.

    so £1.50 becomes ?1.50

    It never used to do this. It is very frustrating when I actually want to show a pound sign and the question mark comes up.

    I use templates that are put up on sites like http://www.oswd.org maybe they are adding something in the CSS files that stops £ signs from showing?

    Can someone tell me what I can type in to make a pound sign show up?
     
    Dean_Saliba, Feb 22, 2008 IP
  2. greboguru

    greboguru Member

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #2
    I always use "<ampersand>#163" see

    http://www.dragonwinds.com/resources/html-codes.shtml
     
    greboguru, Feb 22, 2008 IP
    Halobitt likes this.
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    charset charset charset.

    The template may have a meta tag (near the top, in the <head>) which states something like
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    The example above is from HTML4 and says UTF-8. The other popular one is ISO-8859-1. First, you should have this in your <head> unless you're serving this as XML (which I doubt : )

    Second, the server hosting this page must match up with its HTTP headers. If the server says charset=ISO-8859-1 and your page says charset=utf-8, the server will override the page. But, it might make ?'s.

    Third, since I don't know if this is HTML or XHTML, stay safe and use Unicode or ascii character entities (as greboguru did above-- you beat me to it). If you're typing &#163; from the keyboard, don't. Use & # 163 ; (added spaces so that it would display). Don't use the &pound ; unless you're very sure this will never ever end up on an XML document (most web sites don't anyway though). Otherwise, for plain old HTML &pound ; (without space) is fine.

    ? means the browser has no clue what that thing is. You may also find it on © apostrophes and slashes.
     
    Stomme poes, Feb 22, 2008 IP
    sawz likes this.
  4. greboguru

    greboguru Member

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #4
    Ahhh another thing learn't today! Thanks (again) :)
     
    greboguru, Feb 22, 2008 IP
  5. Dean_Saliba

    Dean_Saliba Notable Member

    Messages:
    1,212
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    225
    #5
    Thank you for helping me.

    In the head part I have:

    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    I replaced the pound sign with & #163 ; (removing the spaces) and it worked perfectly.

    Thanks again guys. :)
     
    Dean_Saliba, Feb 22, 2008 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #6
    So your HTTP header might be a different charset. If you have a hosting provider, they can either change it for your site (since we do still want the two to match) or look at your page's info in your browser to see what their server is using and you could change your site over to that (both are western latin so generally the two look the same on most Western web pages).

    If you make any changes to your html file regarding charset, the editor you are changing it in MUST also save the file with this encoding as well. I forgot about that, but all THREE must match. Common programmes like Notepad usually ask you when saving a new document. For changing one, when you go to save, try SaveAs instead so you can set the new charset.
     
    Stomme poes, Feb 22, 2008 IP