Reputation: 63
My boss asked to use an old SQL Server database and build a new application. When I open it, I found that all the Arabic data appear like this
http://i60.tinypic.com/14lraee.png
Firstname |
ÚÌæØÚÌæØ |
Èä ÍãíÏÉ |
ÈæÒÇäÉ |
ÈæÔÑæÑ |
the column type is already nvarchar
The old application use the same database and retrieve normally all the data arabic and non arabic i dont have the code source of this old application
How can I convert the existent data to appear normally ?
I tried both SQL command like
SELECT UNICODE(@nstring)
or
NCHAR(UNICODE(@nstring))
and C# convert method like
I tried open it with SQL server management studio i tried changing character set , i tried changing the Collection SET but no luck !
Upvotes: 0
Views: 1499
Reputation: 63
string data = File.ReadAllText("d.txt", Encoding.GetEncoding("windows-1256"));
File.WriteAllText("d.txt", data, Encoding.UTF8);
string data2 = File.ReadAllText("t.txt", Encoding.GetEncoding("ISO-8859-6"));
File.WriteAllText("t.txt", data, Encoding.UTF8);
Upvotes: 0
Reputation: 35477
From your clues, I am guessing that the strings in the database are NOT Unicode, but are encoded as some Code Page
, perhaps Code Page 1256 Windows Arabic
If this is the case you then have to Convert Between Legacy Encodings and Unicode
Upvotes: 4