locked
UTF-8 charachters do not appear correctly on ASP.Net page RRS feed

  • Question

  • User-425868192 posted
    Hi,

    I have an ASP.Net page which retrieves data from two sources: From an SQL server table and an XML file.

    Both sources store UTF-8 characters (persian characters), but when retrieving data from them, the page shows a bunch of weired characters (e.g. طنز), instead of proper persian forms.

    I have another set of ASP pages that access the same XML files and they show characters fine (they do not retrieve data fom SQL server).

    As of encoding meta data, I use the same string on both set of pages:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    Any help would be highly appreciated.

    Milad
    Tuesday, July 26, 2005 12:48 PM

All replies

  • User1873438307 posted
    Try to

    Webform SaveAs...

    Save with encoding
    Select UTF-8 with signiture


    Do it for every  page

    HTH
    Tuesday, July 26, 2005 7:12 PM
  • User-425868192 posted

    Hi,

    I did as you instructed, but the problem still persists. Do I have to set something when retrieving data from database and XML files?

    Thanks

    Milad

    Thursday, July 28, 2005 12:45 PM
  • User1873438307 posted
    salam,

    dear ghafoori ,

    Check to see what type of datatype u r using in SQL server, Use unicode datatypes such as , nvarchar,nchar,ntext....

    Tell me if the problem is from data store only, i when u write text to web page, can u see them or not?

    regards
    Thursday, July 28, 2005 2:58 PM
  • User-425868192 posted

    Good day,

    I re-checked the dataypes. I have used nvarchar for persian fields. I guess the problem is from ASP.Net side, not from SQL server, because my other set of ASP pages (they have been written 3 years ago) show the same XML properly.

    Is there any encoding directives that I have to include in my pages (other than <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> )?

    Cheers

    Milad

    P.S.: I work on this project on part-time basis, that is why me posts are once in a while!

    Tuesday, August 2, 2005 9:14 AM