asp.netiis

Big issue with charset


Since I moved our Intranet to a new Server (Windows Server 2008 / IIS 7) I have a problem: instead of special characters such as à, è, ì, ò, ù, €... reversed question marks are stored in the database.

I have the same problem both in ASP.NET and PHP applications.

WHAT I ALREADY TRIED:

Please notice that with the old Server (Window Server 2003 / IIS 6) everything worked fine. And please notice that client-server applications work fine even now, so it's definitely a web applications problem only.

What can I try next?


Solution

  • Some browser (specially older) doesn't recognize special chars directly

    better store ascii code instead of special chars
    e.g. instead of à store "&#224" in database

    1. Get your string from User/Browser
    2. Convert to ASCII
    3. Store ASCII codes in db
    4. Render in every browser/wherever

    here are some links to convert special to ascii

    1. Convert special characters to HTML in Javascript
    2. How to convert characters to HTML entities using plain JavaScript