Hi. OS: Windows 7 64bits Geany version: 1.26
In "Edit>Preferences>Files>Default encoding" I selected IBM850 as default encoding in all options, new files and open files, but all files are opened with 1252 encoding. With new files there is no problem.
Thank you.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/900
I presume you checked "Use fixed encoding when opening non-unicode files"?
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/900#issuecomment-182152743
Yes, is checked.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/900#issuecomment-182156923
If you have selected both the "default encoding" combo boxes in Prefs->Files page, what if you select an explicit encoding in the Open File dialog (options at the bottom)? If this doesn't work or shows an error I think there's a bug in the file's encoding or else in GLib converter.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/900#issuecomment-182159416
Hi. The encoding option in Open File dialog works fine, the file is open with de selected encoding.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/900#issuecomment-182160612
I don't know if it's the same bug but I save the joined file with IBM850 encoding and each time I open it, the encoding is ISO-8859-1 and some characters are wrong like ê that becomes . It's like Geany doesn't detect the right encoding.
[LISEZMOI.TXT](https://github.com/geany/geany/files/11017089/LISEZMOI.TXT)
You need to set the encoding manually, with only a couple of non-ASCII characters its impossible to automatically detect the encoding accurately, several encodings are possibly valid, so when several encodings are valid the choice is arbitary.
On the open dialog `More Options->Set encoding->West European->IBM 850`
I did it: menu Document - Define encoding - West european - IBM 850 but ê that became � remain � on screen, it doesn't become ê.
No, on the Open dialog, not Documents menu.
Geany manipulates all documents as UTF-8 internally, encodings only have any effect on loading or saving the document.
The `Document->Set encoding->...` sets the encoding to save the document as, it has no effect on the UTF-8 in memory.
OK, I found it, it was hidden by default. Thank you. Would it be interesting if encoding have effect on screen (not only when saving the document) when it is set in Document->Set encoding->... too?
The problem is when I open the file with double-clicking on it. It is automatically opened with Geany with the wrong encoding. It would be convenient if Document->Set encoding->... can change the encoding on screen and when registering.
A solution could be having the possibility to choose both the encoding on screen and when saving, separately.
There is no "encoding on screen", the file is converted to UTF-8 when its loaded, it is then closed, no non-UTF-8 artefact remains.
The encoding in memory is always going to be UTF-8, Geany is an IDE, its use-case is editing code (all coding languages are covered by UTF-8) and documentation (and all human languages are covered by UTF-8). Having different encodings in memory makes all the operations of the IDE difficult, and pretty much impractical.
The only thing that may have non-UTF-8 encoding is the file on disk, and the only time that is relevant is reading and writing the buffer in memory, so thats when encoding happens.
You can reload the file with a different encoding `File->Reload As->...`, but you can't change the encoding in the buffer.
Unfortunately there is no solution to the double click problem, there is no command line option to set encoding, and even if "somebody" added one (pull requests are welcome) that just likely means every file is going to be opened with the encoding you teach Nemo to use by setting the option on the command it uses for txt files.
Thank you for your explanations. File->Reload As->... is a good solution for me.
Fundamental operation, won't change.
Both [OP](https://github.com/geany/geany/issues/900#issuecomment-182160612) and recommentor have workarounds.
Closed #900 as completed.
github-comments@lists.geany.org