rickyah / ini-parser

Read/Write an INI file the easy way!
MIT License
971 stars 241 forks source link

Default encoding for ini file #98

Closed francescoformenti closed 8 years ago

francescoformenti commented 8 years ago

Hello, I would like to report a small incoherence in the FileIniParser class: the method: public void WriteFile(string filePath, IniData parsedData, Encoding fileEncoding = null) uses Encoding.ASCII if no encoding provided, but the method: public IniData ReadFile(string filePath) uses Encoding.Default. On an Italian Windows 10 system, it causes the class to write the chars: "òàùèéì" in ASCII and, when read, these chars are wrongly loaded. Forcing the encoding in the two methods fixes the problem, but I would advice to correct this incoherence. Thanks for your great work!

Regards Francesco

rickyah commented 8 years ago

Thanks @francescoformenti for the bug report! I'll make ASCII the default encoding and I'll also update the mid library version as this could break compatibility