I have a database in ISO-8859-2 format, but I need to create XML in UTF-8. This means that I must encode the database before printing in UTF-8. I know very little about ASP.Net.
In PHP I would do something like this:
db_connect(); mysql_query("SET NAMES 'UTF8'"); mysql_query("SET character_set_client='UTF8'");
This is my ASP.Net code for database connection:
'CONNECTION TO DATABASE dim dbconn,sql,dbcomm dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath("../baze/test.mdb")) dbconn.Open() sql="SELECT * FROM nekretnine, tipovinekretnina WHERE nekretnine.idtipnekretnine = tipovinekretnina.idtipnekretnine ORDER BY nekretnine.idnekretnine" dbcomm=New OleDbCommand(sql,dbconn) dbread=dbcomm.ExecuteReader() while dbread.Read()
Where and how do I encode to UTF-8?
Assuming you have a value string in
str, this is the pure-.NET way of doing this.