asp.net chinese encoding

P

pabv

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:
<globalization requestEncoding="utf-8" responseEncoding="utf-8"
fileEncoding="utf-8" culture="zh-CN"/>
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:
<globalization requestEncoding="gb2312" responseEncoding="gb2312"
fileEncoding="gb2312" culture="zh-CN"/>
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top