simonsteele / pn

Programmer's Notepad
374 stars 115 forks source link

File Changes Detected does not amend Encoding #132

Open JohnLBevan opened 7 years ago

JohnLBevan commented 7 years ago

If a file's encoding is changed whilst open in PN, though file changes may be detected, the encoding information shown by PN does not update.

Reproduction steps:

Create a file with ANSI encoding (e.g. powershell: Get-Process | Export-CSV -Path 'c:\myFile.csv' ) Open in this file (c:\myFile.csv) in PN & click File, Encoding; it says ANSI. Overwrite the file with UTF8 encoding (e.g. powershell: Get-Process | Export-CSV -Path 'c:\myFile.csv' -Encoding UTF8 ) Navigate back to PN; an alert warns that the file has changed and should be reloaded; click yes. The content of the file is updated as expected; however navigating to File, Encoding it still shows ANSI.

Closing the file (without saving) and reopenning in PN shows that the file's encoding is UTF8; i.e. only the file's information hadn't been updated when it was reloaded due to the detected change.