ADO VS. ADO.NET character encoding problem

K

Kivanc Toker

Hi,

I've got a problem with displaying texts with turkish characters.

There is a website administration system, which is developed using ASP
(VBScript) and ADO. This system is being used for inserting product
informations in to a ms-sql database.

There is another webbased application, which is developed using ASP.NET and
ADO.NET (C#). For this second application there is a separate ms-sql
database but the data on the first database is also being accessed and
displayed and that is exactly where my problem occures. The data, which was
written in to the database by the first application (ADO) can not be read by
the second application (ado.net) properly. Some of the turkish characters
are displayed as questionsmarks etc. The field at the database is NVARCHAR
(unicode).

Is there a way setting the encoding for a dataadapter before calling the
fill method? Or is there another workarround for this problem? Thanks in
advance.

Kivanc Toker
TUM Group IT Soluotions
 
K

Kivanc Toker

Got new informations about the problem.

http://forums.asp.net/518209/ShowPost.aspx

The most interesting part is :

"CAUSE:
The reason I found out was that each gb2312 character I store in MSSQL 2000,
it convert to unicode, splitting the double-byte characters into single
bytes, then converting each single-byte based on the codepage in
windows-1252 to the corresponding unicode equivalent.
Legacy ASP works, because everything is converted back from unicode back
into single-byte "char" (vs double-byte "char" in ASP.net), and all we have
to do is to set the response.charset=gb2312 to get it to work.
However in ASP.net, the WebForm does conversion base on the webform codepage
and webform charset, including the web.config globalization
responseEncoding, requestEncoding and fileEncoding. Hence you have to
manually set the webform codepage to windows-1252, but webform charset has
to be set to gb2312. During page_load, you have to type in
"response.charset=nothing" to display the data from MSSQL with no problem.
"

The problem is I didn't get the solution. I have the same problem with
turkish characters and I still need help.

Thanks in advance..

Kivanc Toker
 

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

Top