Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Apostrophes appear as squares in html

    Hi, I am coding an XHTML 1.0 transitional page and have a <p> tag with some text that includes apostrophes and a degrees celcius. When i preview them in IE or firefox the apostrophes and the degrees celcius do not appear as they should. Any ideas? thanks.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,606
    Thanks
    6
    Thanked 997 Times in 970 Posts
    Do you mind showing us your code please?

    Sounds like a character encoding issue. You should always use UTF 8 encoding (specified in the resective meta element). If you wanna be 100% sure then use HTML entities such as &deg; for the degree sign.

    And please don’t use a transitional doctype. The only thing you should use is strict.

  • Users who have thanked VIPStephan for this post:

    waq963 (05-28-2009)

  • #3
    New Coder
    Join Date
    May 2009
    Posts
    74
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by waq963 View Post
    Hi, I am coding an XHTML 1.0 transitional page and have a <p> tag with some text that includes apostrophes and a degrees celcius. When i preview them in IE or firefox the apostrophes and the degrees celcius do not appear as they should. Any ideas? thanks.

    Please paste your code here.

    Regards.

  • #4
    New to the CF scene
    Join Date
    May 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Here is my code, i have put in some dummy code in the <p> tag because it was quite long. By the way I am using Notepad++.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Introduction</title>
    <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
    </head>
    
    <body>
    <h4>Introduction</h4>
    <p>
    My name is 'John' my temperature is 36°C		
    </p>	
    </body>
    </html>
    Last edited by waq963; 05-28-2009 at 11:42 AM.

  • #5
    New Coder
    Join Date
    May 2009
    Posts
    74
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by waq963 View Post
    Here is my code, i have put in sum dummy code in the <p> tag because it was quite long. By the way I am using Notepad++.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Introduction</title>
    <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
    </head>
    
    <body>
    <h4>Introduction</h4>
    <p>
    My name is 'John' my temperature is 36°C		
    </p>	
    </body>
    </html>


    Try using "&deg;" without the double quotes for degree and " ' " without the double quotes for apostrophe.





    Regards,
    Last edited by frankle; 05-28-2009 at 11:43 AM.

  • #6
    New to the CF scene
    Join Date
    May 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks that worked fine. What can i do about the apostrophes not showing?

  • #7
    New Coder
    Join Date
    May 2009
    Posts
    74
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by waq963 View Post
    Thanks that worked fine. What can i do about the apostrophes not showing?

    Here it is:


    &acute; = ´


    Regards,
    Last edited by frankle; 05-28-2009 at 12:02 PM.

  • Users who have thanked frankle for this post:

    waq963 (05-28-2009)

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    I think I have another solution
    Just change the encoding type of your file to utf-8 (in notepad => Choose "Save As" option and change; in notepad++ => Change from the format menu) and then after you could display any utf characters typed in your file as such in your browser.
    Last edited by abduraooft; 05-28-2009 at 01:24 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    waq963 (05-28-2009)

  • #9
    New to the CF scene
    Join Date
    May 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks guys, it works now.

  • #10
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,606
    Thanks
    6
    Thanked 997 Times in 970 Posts
    Quote Originally Posted by frankle View Post
    Here it is:


    &acute; = ´


    Regards,
    This is not an apostrophe, it’s an accent.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •