Reputation: 20358
I have text file which contains Arabic words. And i using StreamReader
to read the text file and and StreamReader
not getting those words and return ??????.
I tried Binary reader to but it's not reading that. I am using windows application. Please let me know any ways.
Upvotes: 1
Views: 4528
Reputation: 107
StreamReader sr = new StreamReader(path,Encoding.Default,true);
string dataReader=sr.ReadToEnd();
sr.Close();
try and see it's right
Upvotes: 1
Reputation: 15951
Try specifying the encoding using this StreamReader constructor:
StreamReader reader = new StreamReader(filePath, System.Text.Encoding.UTF8, true);
For reference: http://msdn.microsoft.com/en-us/library/ms143457.aspx
Upvotes: 2