lipkau / PsIni

Work with INI files in PowerShell using hashtables
http://lipkau.github.io/PsIni
MIT License
151 stars 50 forks source link

Can't save as ANSI or save characte — (dash em) #71

Open rasmusroessum opened 2 years ago

rasmusroessum commented 2 years ago

I tried to save — in my ini-file, but it got saved as UTF-8 with BOM, where I would like it saved as ANSI.

rasmusroessum commented 2 years ago

To fix this please change this in Get-IniContent:

switch -regex -file $FilePath) {

to:

switch -regex (Get-Content $FilePath) {

And add 'default' for encoding in Out-IniFile