Hi,
I am facing an issue while importing special characters from excel sheet.
Special characters includes (¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÜÝÞßàáâãäåæçèéêëìíîïðñòóôö÷øùúûüýþÿ)
I am using streamreader to import this text and no parameter is passed to streamreader, so default is UTF-8.
After import the special chater are displayes as "?".
Where Encoding.Default is passed as parameter to streamreader the special charter are displaying propery.
But I came across this msdn post which says Encoding.Deafult is not advisable to use.
https://msdn.microsoft.com/en-us/library/system.text.encoding.default(v=vs.110).aspx
Does Encoding.Default can change in 2 different systems and will it handle special characters from other language?
My code looks like this:
FileStream fs = new fileStream(sFileName,FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
StreamReader sw = new StreamReader(fs);
String sbuf = sw.ReadLine();
When I read the csv file having above mentioned special characters, sbuf value is showing as ?
It works fine when I use Streamreader like this.
StreamReader sw = new StreamReader(fs,Encoding.Default);
I just want to know will there be any issues if I use Encoding.Default.
How it behaves if some more characters from different code page comes. Does this result in data loss.
Can someone share your thoughts on this.