Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as part of a datagrid. When an input textbox is displayed it does not
display chinese characters, but rather the unicode characters stored in the mssql 2000 server backend. To get this setting to work I have the following web.config file setting: and on page load I programatically set the following: Response.Charset = "gb2312";
these are the settings I use to get the above results. I have tried setting the web.config to: but this provides little help. Additionally I have used some of the suggestions in the following post http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=518209
by overriding the TextBox Text property where in set I do the following: set { base.Text = ToSCUnicode(value); } which can display correct chinese characters on the initial page load, however, when this page performs a post-back these chinese characters are
converted back to I assume unicode (could be wrong.) I am hoping someone may have some experience/suggestions to lead me on to the right track to solve this problem, any feedback would be appreciated. Thanks
I think I have made some progress in finding the error to this problem. I realised that the error seemed to be happening with the asp.net textbox control. I than investigated further and realised the error where the chinese character symbols are not being displayed
correctly on the browser occurs with multiline textbox. Multiline textbox (texbox with TextMode = TextBoxMode.MultiLine) are rendered on the browser by asp.net as a textarea. This results in unicode characters (ie. characters not translated by the codepage
encoding process) being displayed on both page-load and any subsequent page-postbacks before final page submission to have data saved to the mssql backend. So I populated a singleline textbox, and on the browser and it displayed the chinese character symbols
correctly. This results in both page-load and page-postbacks displaying the chinese character symbols correctly. Hence, it seems to occur when I populate a multiline textbox that it is rendered as a textarea in html. I went a step further and this time I created
a html server textarea control (HtmlTextArea). I populated the control, and on page-load the chinese character symbols are displayed correctly on the browser. However, when I change the text inside the htmltextarea control, on page-postback the chinese characters
symbols are no longer displayed correctly. So one question I have is what encodings/processes are occurring on page-postbacks that is causing the htmltextarea control to have this issue? And most importantly why is the multiline textbox not displaying chinese
character symbols correctly when the htmltextarea control partially is? I will investigate further. Perhaps someone may have some ideas as to whether this has any importance to the issue.
pabv
Member
10 Points
2 Posts
chinese encoding
Oct 11, 2004 06:01 AM|LINK
pabv
Member
10 Points
2 Posts
Re: chinese encoding
Oct 14, 2004 01:43 AM|LINK