Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Dashes, apostrophes and quote marks converting to special characters

  1. #1
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Dashes, apostrophes and quote marks converting to special characters

    I'm hoping someone can help me with this, I'm hoping it's a simple fix.

    We just moved our website to a new hosting company (GoDaddy). Since then, a lot of basic, non-text characters, have begun displaying as square boxes (in ie) or question marks in a reverse field diamond (Firefox). These pages were all working prior to the server switch.

    The characters affected are dashes, apostrophies and quote marks.

    I'm hoping there's something I can do to solve this without going into every page and entering the ascii code by hand.

    Any ideas? Is there a code I can add to each page or a setting elsewhere I can change to fix this?

    Some Samples are: http://www.girlscoutsjs.org/shop/shopGroovyGirls.php and its homepage.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Your page is in ISO-8859-1, but the server is saying it's in UTF-8. Update your server config to send the correct encoding, or convert the pages into UTF-8. If you do the latter (which is preferable, since UTF-8 can encode a great many more characters than ISO-8859-1 at [generally] no cost), there is a tool here to help you on Windows.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey View Post
    Your page is in ISO-8859-1, but the server is saying it's in UTF-8. Update your server config to send the correct encoding, or convert the pages into UTF-8. If you do the latter (which is preferable, since UTF-8 can encode a great many more characters than ISO-8859-1 at [generally] no cost), there is a tool here to help you on Windows.
    I converted the pages to UTF-8 by changing the line in the head area to read
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    That seems to be working on the actual web pages like the link I initially gave.

    It's still having problems with pages that are created using csv files. (see http://www.girlscoutsjs.org/php/viewAllNewsReleases.php) The date and title on this page is pulled from a csv file. I ran the csv through the converter you linked to, changed the new file's name and then uploaded it to the server, but no luck.

    Is there something I'm missing?

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I converted the pages to UTF-8 by changing the line in the head area to read
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    That's not converting them at all.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey View Post
    That's not converting them at all.
    Pasted the old one by mistake. Does this do it? If not, what else needs to be done? It's a text file. Once you select the charset to use, what else needs to be converted?

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

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Pasted the old one by mistake. Does this do it?
    No. By adding an encoding <meta> tag you're telling the browser what charset to use (well, not in this case: the server's HTTP header overrides it anyway), but that's no good if the file isn't actually in that encoding. That's where your whole problem springs from in the first place.
    It's a text file. Once you select the charset to use, what else needs to be converted?
    The text file. Your editor will probably have an option to select a character set when saving, or you can use the program I provided above (or similar) to do it automatically.

    Also, the /> ending for self-closing tags is only correct in XML, but the text/html MIME type is for HTML. See http://www.webdevout.net/articles/beware-of-xhtml.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Dear Twey: I must say I found that article about XHTML alarming considering all the pages I have created for the past 1.5 years start with:

    <!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=iso-8859-1" />

    This was what Dreamweaver 8 gave you by default as a new page. I upgraded a few months ago to Dreamweaver CS3 and the default is the same except it changed the charset to UTF-8. After reading that article I'm thinking perhaps I should change everything back to HTML 4.01, but should it be "Strict" or "Transitional"?

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    What do you recommend? And if I change to HTML 4.01, should I go back to using <br> instead of <br />. It is very unnerving. I wonder if this is why some of my pages, after I converted them from tables to pure css, started acting funny (flickering & disappearing" - I never saw it myself, but clients reported this) in IE, especially < IE7.

    Just when I thought I was getting somewhere. Geesh! That article was a bit hard to read. I would appreciate your conclusions. Thanks very much. erin

  8. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Go to strict. transitional is 10 years old and being phased out. Soon we will all be recoding for HTML 5.00 anyway
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  9. #9
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Dear B: OK, so is this what goes at the top of each page?...

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    And if I make that change to all my pages, are there other things I have to do to avoid disruption to the display of my live sites? I have been using <br /> and /> for meta-tags and image tags.

    Thanks! (we've got to stop meeting like this haha) erin

  10. #10
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    You will have some problems yes. Easiest thing, is swap all your headers to the strict version, and then check with a validation site.

    If you run FireFox, you can get the add-on called "Total Validator" which puts a little icon in your lower right corner of the browser, then what ever page is active, you click the icon and it validates the page. It is quick and handy.

    The other (more trusted) option is to go to http://validator.w3.org/ and type in the url of the page you want to check.

    Keep fixing and re-fixing until it turns green
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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