C#

Hagi 2020. 3. 10. 15:24

949 ks_c_5601-1987 Korean

String sTxt = File.ReadAllText("파일이름", Encoding.GetEncoding(949));

StreamReader sr = new StreamReader("파일이름", Encoding.GetEncoding(949));

=>

65001 utf-8 Unicode (UTF-8)

String sTxt = File.ReadAllText("파일이름", Encoding.GetEncoding(65001));

StreamReader sr = new StreamReader("파일이름", Encoding.GetEncoding(65001));


변경하여 에러 해결


참고 

https://docs.microsoft.com/ko-kr/dotnet/api/system.text.encodinginfo.getencoding?view=netframework-4.8