ad-sol
asked on
C# 1256 file encoding
Hello
I am facing an encoding problem.
I want to write information to a file ( Arabic Letters ( windows-1256 ) ), but the letters are written in UTF-8 , here is the code :
FileStream afile = new FileStream ("school_db.sql", FileMode .OpenOrCreate);
StreamWriter sw = new StreamWriter (afile);
string test = "شكر 75; على المž 7;ا& #1593; 83;ة ";
sw.WriteLine(test);
sw.Close ();
So I want to convert the variable :' test' to windows-1265 befor writing it to the file.
Thank you for your help
Regards
I am facing an encoding problem.
I want to write information to a file ( Arabic Letters ( windows-1256 ) ), but the letters are written in UTF-8 , here is the code :
FileStream afile = new FileStream ("school_db.sql", FileMode .OpenOrCreate);
StreamWriter sw = new StreamWriter (afile);
string test = "شكر
sw.WriteLine(test);
sw.Close ();
So I want to convert the variable :' test' to windows-1265 befor writing it to the file.
Thank you for your help
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you PockyMaster