I want to insert info.NativeName into a nvarchar field in the database. It doesn't work, all I get is ??????? where the encoding is not western/latin.
Outputting listcultures directly in an asp.net website on page_onload worked fine, but it seems not to work via database.
Public Sub listcultures()
'Dim x As System.DateTime = DateTime.Now
'Response.Write(x.ToString("HH':'mm':'ss MMM d', 'yyy 'PST'", New System.Globalization.CultureInfo("zh-CN", False)))
Dim info As System.Globalization.CultureInfo
For Each info In System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures)
'Response.Write("Deutsch: " + info.DisplayName + " English: " + info.EnglishName + " Native: " + info.NativeName + " Name: " + info.Name + " Codepage: " + info.TextInfo.ANSICodePage.ToString() + "<br />")
'InsertData(info.DisplayName, info.EnglishName, info.NativeName, info.Name, info.TextInfo.ANSICodePage.ToString(), info.IsNeutralCulture.ToString())
If Not info.IsNeutralCulture Then
'item.SubItems.Add(amount.ToString("C", info.NumberFormat))
'item.SubItems.Add(dateNow.ToString("d", info.DateTimeFormat))
End If
Next
End Sub
What am I doing wrong? I suppose something with encoding ?