1

I have an old system that uses varchar datatype in its database to store Arabic names, now the names appear in the database like this:

  "ãíÓÇÁ ÇáãÈíÖíä" 

Now I am building a new system using VB.NET, how can I read these names to appear in Arabic characters?

Also I need to point out here that the old system even it stores the data as I mentioned earlier it converts the characters in a correct format.

How to display it properly in the new system and in the SQL Server Management Studio?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Majdi Asha
  • 31
  • 2
  • 5

3 Answers3

1

have you tried nvarchar? you may find some usefull information at the link below

When must we use NVARCHAR/NCHAR instead of VARCHAR/CHAR in SQL Server?

Community
  • 1
  • 1
Mo Patel
  • 2,321
  • 4
  • 22
  • 37
1

I faced the same Problem, and I solved it by two steps:

1.change the datatype of the column in DB into nvarchar

2.use the encoding to change the data into Arabic

I used the following function

     private string GetDataWithArabic(string srcData)
    {
        Encoding iso = Encoding.GetEncoding("iso-8859-1");
        Encoding unicode = Encoding.Default;
        byte[] unicodeBytes = iso.GetBytes(srcData);
        return unicode.GetString(unicodeBytes);
    }

but make sure you use this method once on DB data, because it will corrupt the data if used twice

0

I think your answer is here: "storing and retrieving non english characters" http://aalamrangi.wordpress.com/2012/05/13/storing-and-retrieving-non-english-unicode-characters-hindi-czech-arabic-etc-in-sql-server/

Ian P
  • 1,724
  • 1
  • 10
  • 12