Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

When i try to retrieve swedish characters like Ö Å é from the database into the dataset, it is displayed as Ö Ã… é when I view the dataset values by debugging.


How do I correctly retrieve the data?

I have tried the following which didn't work:
1. In code behind:
VB
Dim currentCultureInfo As New CultureInfo("sv-SE")
        dataSet.Locale = currentCultureInfo

2. In web.config :
VB
<globalizatio<n fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="sv-SE" uiCulture="en-US" /> 



Kindly help me sort this issue.
Thanks in Advance !!!
Posted

try UTF-32 since UTF-8 might not be able to represent all the characters
 
Share this answer
 
2 things:
1)
What kind of data type do you set for text fields? Probably you need NVARCHAR instead of VARCHAR

2)
You need to encode data...
Note:
To set the encoding for an individual page, set the RequestEncoding and ResponseEncoding attributes of the @ Page directive, as shown in the following example:

<![CDATA[<%@ Page RequestEncoding="utf-8" ResponseEncoding="utf-8" %>]]>



See related links:
http://msdn.microsoft.com/en-us/library/39d1w2xf%28v=vs.100%29.aspx[^]
Using Character Encoding in ASP.NET[^]
http://msdn.microsoft.com/en-us/library/system.text.encodinginfo.codepage.aspx[^]

More about encoding and globalization for ASP.NET, you'll find here: http://msdn.microsoft.com/en-us/library/h6270d0z%28v=vs.100%29.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900