SjoerdV / ConvertOneNote2MarkDown

Ready to make the step to Markdown and saying farewell to your OneNote, EverNote or whatever proprietary note taking tool you are using? Nothing beats clear text, right? Read on!
GNU General Public License v3.0
196 stars 113 forks source link

If utf-8 string in some markdown file has broken, need to specify UTF8 #32

Open ozdang opened 1 week ago

ozdang commented 1 week ago

If utf-8 string in some markdown file has broken, need to specify UTF8 encoding to Get-Content and Set-Content pairs

like from

((Get-Content -LiteralPath "$($fullexportpathwithoutextension).md" -Raw).Replace("$($pageinsertedfile.InsertedFile.preferredName)", "[$($destfilename)](./$($destfilename))")) | Set-Content -LiteralPath "$($fullexportpathwithoutextension).md"

to

((Get-Content -LiteralPath "$($fullexportpathwithoutextension).md" -Raw -Encoding UTF8).Replace("$($pageinsertedfile.InsertedFile.preferredName)", "[$($destfilename)](./$($destfilename))")) | Set-Content -LiteralPath "$($fullexportpathwithoutextension).md" -Encoding UTF8

.

Repeate all Get-Content and Set-Content pair (current version has 4 pairs)