locked
Unable to Save/Display Chinese characters from database RRS feed

  • Question

  • User-896422094 posted
    I have a page with a lable lblName, a Text box:txtName and a submit button. User types in Chinese text and saves the text box content into a table by clicking on the submit button. A second page retrieves the data from table and displays on a web page. The page can't display the text in Chinese. I save the .aspx file with save with encoding-->utf-8 encoding with signature code page 65001. Label lblName in first page is in Chinese and is hard coded and it displays fine but data retrieves from the table is not. Can anyone help? I am pretty new to .net and this seems like a stupid question. P.S. A similar page written in traditional asp 3.0 works perfectly with Response.ContentType = "text/html; charset=utf-8" tag
    Friday, March 12, 2004 4:29 AM

All replies

  • User424282587 posted
    If you are using English Windows 2000 with SQL 2000 (english version too), then do the following: (1) Web.config. <globalization> responseEncoding="Windows-1252" requestEncoding="Windows-1252" fileEncoding="Windows-1252" </> (2) in the .aspx webform (within VisualStudio.NET), I have to set charset=gb2312 codepage= (blank) (3) in the code behind for PAGE_LOAD to the .aspx webform in (2), I have to enter: response.charset=nothing
    Monday, March 15, 2004 3:43 PM
  • User-896422094 posted
    Got it. Found the solution in this link. http://asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=160673
    Tuesday, March 23, 2004 5:30 AM
  • User424282587 posted
    The above solution is actually a bad workaround causing other problems. A permanent solution is documented in the following post: http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=518209 which allows you to use the appropriate web.config settings as follows: (1) Web.config. <globalization> responseEncoding="gb2312" requestEncoding="gb2312" fileEncoding="gb2312" </> (2) in the .aspx webform (within VisualStudio.NET), set the following charset=gb2312 codepage=936 (3) in the code behind for PAGE_LOAD to the .aspx webform in (2), you no longer need to have "response.charset=nothing", as everything is converted between gb2312/windows1252 and unicode(UTF16) correctly.
    Friday, March 26, 2004 10:34 AM
  • User2056439337 posted

    Hi,

       I am facing a wierd problm.  I am able to display the international characters from the database (exisiting data), but when i edit and save the data (only international data) through my application, the data gets corrupted and displays junk characters.

    I am using OracleCommand to update the data into the database (which might be culprit)

    Any ideas on how to fix this ?

     

    Thanks,

    SK

     

     

    Thursday, April 28, 2005 5:04 PM