#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    289
    Rep Power
    0

    ANSI 1252 and UTF-8 encoding


    Hi everyone,

    I have a small database that I've made few years back and it is hosted on my old personal computer. I want to get rid of that and put my sytem on my website directly.

    I saved all the files with FileZilla from my homemade server (Windows 7 + WAMP) and also exported my phpmyadmin database.

    On my website, I created a new folder, uploaded all the files that I previously saved with FileZilla.

    When I open that folder with a web browser, all french accents (, , , , etc..., yes, I'm french) were gone and question marks were displayed. I tried with numerous browsers and it's the same.

    I know it has something to do with file encoding, files that were on my homemade server seems to be encoded with 'ANSI 1252'.

    If I open them with Ultra-Edit, it says so on the bottom bar, but in the editor, I can see the french accents, but with the browser, it shows question marks.

    I had this on my webpages;

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    Code:
    <meta http-equiv='content-type' content='text/html;charset=ISO-8859-1'>
    I removed it, same results. I tried to put 'UTF-8' on my page, and it still show questions marks.

    The only thing that seem to works is changing the file encoding directly to UTF-8, but all french accents in the source code gets changed to strange characters automatically and if I save the file, those strange characters appears on the webpage, so I have to manually change all those strange characters on each page to make it work. All new inserted chars are correctly displayed after that.

    Is there a way to make everything that worked on my homemade server work 'out of the box' on the web hosting? A line of code that would prevent those characters to show like that?

    I'm not very good with file encoding, so I don't actually know why this is happening, I would have thought that it would have worked right away?

    Will I encounter the same issue with my MySQL database?

    Thanks a lot.
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,833
    Rep Power
    9646
    ANSI 1252, or as it's more commonly known CP 1252, is basically ISO 8859-1. For the record.

    UTF-8 is superior. Open the file in whatever editor you're using and save it in that encoding. Verify it works on your computer. Then upload it, making sure that FileZilla is uploading in binary mode.

IMN logo majestic logo threadwatch logo seochat tools logo