views:

70

answers:

2

When using arabic language, data is stored in database with ? (question mark) sign instead of real arabic characters in SQL server. Suggest me solution if anybody have idea.

A: 

There are several possibilities here:

  • Your language of choice is not encoding the text properly. Make sure you use unicode strings.
  • You are transferring the data incorrectly. Are you using the correct SQL types? NVarChar instead of VarChar, NChar instead of Char for your stored procedure parameters.
  • You are saving the data incorrectly. Again you should be using NVarChar fields instead of VarChar, NChar instead of Char etc...

You should be using unicode character strings at all places. See the list of SQL Server data types.

Oded
I am converting data to nvarchar before storing it to DB. The data type of field where data is being stored is xml? Is it create problem ?
Nijesh patel
@Nijesh patel - Are you storing regular text in a XML field? It is not XML?
Oded
A: 

To store this kind of the data Datatype of the columns required to set as nvarchar

and also check the function which is passing data to database is the sql parameter is nvarchar or not

also check this question answer : http://stackoverflow.com/questions/35366/varchar-vs-nvarchar-performance

Pranay Rana
the data type is `NVARCHAR` - not nvachar - fixed typo
marc_s