rickyah / ini-parser

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

© gets rewritten as ? #217

Closed shaggygi closed 3 years ago

shaggygi commented 4 years ago

Seems like the copyright system © gets changed to '?' when using WriteFile method.

I noticed this when trying to set a value to a specific attribute and other attributes that have © are getting changed to ?.

_data[sectionName][attributeName] = attributeValue;
_parser.WriteFile(_filePath, _data);
Willy-Kimura commented 3 years ago

Seems like you'll need to specify the type of encoding:

_parser.WriteFile(_filePath, _data, System.Text.Encoding.UTF8);
shaggygi commented 3 years ago

I figured it out, but forgot to close out. It turns out the files I'm working with is not supported by .NET Core (as it is a specific Windows encoding). The files are supposed to be updated to UTF-8 in the near future, so I can use with .NET Standard/Core at that time. Closing issues.