Unicode became "???" when putting ASP.NET 2.0 code under virtual directory of ASP.NET 1.1 RRS feed

  • Question

  • User1247955105 posted


    I am using Windows 2003, IIS 6, Atlas and Web Service.

    I have set up a website using ASP.NET 2.0 framework, and put that under a virtual directory with its own Application Pool and web.config.  The virtual directory is under a website built with ASP.NET 1.1 framework.  Everything works well, except when displaying unicode, which turned into a bunch of "?".

    However, when I create a new website and put the same exact code in there, the unicode turned out correctly.  It's also fine when I use the built-in Visual Studio 2005 web server.

    This is what I do to display unicode:

    Encoding iso = Encoding.GetEncoding(1252); //data is stored in sql server 2k that accept windows-1252
    Encoding isouser = Encoding.GetEncoding(950); //data is originally big5, so need to convert back to big5
    byte[] unicodeBytes = iso.GetBytes(text);
    return isouser.GetString(unicodeBytes); //return the string and pass toAtlas to display


    I need to do such conversion because if I don't convert to readable text before sending it over via Atlas and Web Service, it sends whatever gibberish you see in the database and changing browser encoding setting to view text doesn't help.

    Is this a bug?  Does putting ASP.NET 2.0 under ASP.NET 1.1 cause problem normally?



    Tuesday, December 20, 2005 3:27 PM

All replies

  • User1416329745 posted

    You are getting character conversion you may need to do unicode encoding in VS and do column level collation in the database with unicode data types in SQL Server.  Try the link below for unicode encoding in VS and run a search for column level collation in SQL Server BOL (books online).  I am assuming you know there are many Chinese character code pages in SQL Server.  Hope this helps.


    Tuesday, December 20, 2005 4:34 PM