Question : how to get data in UTF-8 mode from database?

i want to display Arabic on page which is in database currently but i dont know what is  the encoding for this database. I have displayed the code on page but it shows me garbage. i use this in my application but nothing changed.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" culture="ar-SA" uiCulture= "ar" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


///////////////////////////////////////////////////////////////////////////////////////////////////////////////
<globalization requestEncoding="windows-1252" responseEncoding="windows-1252" culture="ar-SA" uiCulture= "ar" />

 
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">


Please guide me.Thanks

Answer : how to get data in UTF-8 mode from database?

first of all, you have to use unicode types to store international language data. types start with 'n' like nchar nvarchar ntext are used to store unicode data in sql server. moreover if you are storing literal text through insert statment then you have to prepand 'N' before data.

eg.

Insert into TestTable

Values(N"ahmedabad")      !-- instead of ahmedabad you can consider arabic data.

Random Solutions  
 
programming4us programming4us