Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET ADO.NET VB.NET
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:
Dim currentCultureInfo As New CultureInfo("sv-SE")
        dataSet.Locale = currentCultureInfo
2. In web.config :
<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 8-Nov-12 20:33pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

try UTF-32 since UTF-8 might not be able to represent all the characters
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 851
1 OriginalGriff 390
2 CPallini 265
3 George Jonsson 191
4 Kishore Pogaru 160
0 OriginalGriff 5,450
1 Sergey Alexandrovich Kryukov 4,532
2 CPallini 4,500
3 George Jonsson 3,102
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100