This got broken by 907a79263d907fa354d3b4c6570f33047801dd84 back in 2011 as encoding names started to be compared more permissively, leading to "none" matching the "None" encoding.
This shouldn't be too much of a problem as trying the None encoding first should not cause any issue, but fix loading of the option anyway.
This however won't restore settings from existing configuration files that used the previous code, as there is no way to tell whether the user selected the None encoding voluntarily or not.
---
To reproduce the issue, go to the file preferences, and deactivate the *Use fixed encoding when opening non-Unicode files*. Save the setting, and restart Geany: you'll see the setting is activated again.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1326
-- Commit Summary --
* Fix loading the default open encoding option
-- File Changes --
M src/keyfile.c (4)
-- Patch Links --
https://github.com/geany/geany/pull/1326.patch https://github.com/geany/geany/pull/1326.diff
LGBI
Looks good after testing (I forgot @elextr fancy abbreviations 😄 )
@b4n, not sure, but I think this is affected by the problem I raised on IRC, the encoding used to load a file, and which will therefore be stored in prefs, might not be one in our list of encodings, so `encodings_get_from_charset()` will give null. Have I missed somewhere in the spaghetti that is encodings where the saved string is used for loading the file?
Unresolved questions, moved to 1.31
@elextr I'm not 100% sure but I can't see how an encoding outside our list can end up here, it's not like we detect it with a regex. So I don't think it's a problem, and if there is one indeed it's a separate issue and this still fixes the problem at hand and doesn't introduce a new one. So, feel free to report a separate bug if needed.
Merged #1326 into master.
@b4n, can't remember, that was _years_ ago, as I said above LGBI so I will take your word for it.
github-comments@lists.geany.org