Link to home
Start Free TrialLog in
Avatar of ad-sol
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 = "شكرا على المساعدة ";
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
Avatar of PockyMaster
PockyMaster
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ad-sol
ad-sol

ASKER

Yes, it is working now,
Thank you PockyMaster