I wrote a c# program for move some records from a big db with Latin1 to a small db with Arabic. All things good but Unicode strings from source has an encoding that I cant decode them. Help me please!
Asked
Active
Viewed 366 times
2 Answers
0
I think you have to use the column of NVARCHAR
datatype, to support translation to Arabic Characters.
Here is the link which could be useful to you, Please go through this link

HarshSharma
- 630
- 3
- 9
- 34
-
thanks for reply! (sorry! icant edit my comment in 5 minute and i sent another comment!) source and destination column is NVARCHAR. db1 collation is SQL_Latin1_General_CP1_CI_AS and it's unicode strings saved like "ظ†ع¯ظٹظ† 9", but db2 collation is Arabic_CI_AS and it's unicode strings saved like "نگین 9" that is true. i need a subroutine in c# that convert db1 string to db2 string. i test ENCODING, "N''" and Decoder. – Sayyad84 Jan 07 '14 at 07:34
-
can you please elaborate, i mean why do you want to convert the string if it is saving fine at back end, do you want to say that, you want to display special characters saved at backend to the front end... – HarshSharma Jan 07 '14 at 07:49
-
software1 has db1 and software2 has db2 and i want to move some of db1 records to db2. db1_records are requests from very location that only one location relate to us and i have to move these special records to our software db to work on them. these DBs have different collation and have to convert them. software2 cannot show strings with software1 encoding. (sorry for my english) – Sayyad84 Jan 07 '14 at 08:01
-
I am sorry, because i can't understand you fully, but i guess you mean you want to convert data from one collation to other while using the `Select` statement, so i think you so go through this [link](http://stackoverflow.com/questions/8089907/sql-server-convert-varchar-to-another-collation-code-page-to-fix-character-e) – HarshSharma Jan 07 '14 at 09:01
0
i found that db1 encoding is 1256 and i use this commands to convert to utf8:
string INs = "ظ†ع¯ظٹظ† 9";
byte[] bb = Encoding.GetEncoding(1256).GetBytes(INs);
s = Encoding.UTF8.GetString(bb);

Sayyad84
- 1