Gedit 3.36.2 is showing an error when opening a file:
There was a problem opening the file “[…].txt”.
The file you opened has some invalid characters. If you continue editing this file you could corrupt this document.
You can also choose another character encoding and try again.
Gedit shows a banner indicating Character Encoding “Current Locale (UTF-8)” as selected, and the drop down box also has Unicode (UTF-16), selecting it does not seem to make a difference and the drop down box always goes back to showing UTF-8.
chardetect [file]
shows UTF-16 with confidence 1.0
.
Other editors like LIbreOffice, Pluma (on another system), and VS Code all open the file without issues. VS Code identifies the encoding as UTF-16LE.
What is going on with Gedit?