I suppose I can remove my own plugin:
def on_pre_save(self, view):
def_encoding = view.settings().get("default_encoding")
if view.encoding() == 'Undefined':
if def_encoding is not None:
view.set_encoding(def_encoding)
It works great, thanks a lot! And I don’t even have to change my settings name
Now there are still an issue for me:
My .pas (Pascal) files have the default_encoding and fallback_encoding to “Western (Windows 1252)” and are saved correctly when I create a new file. OK
When opened, .pas files that contains non ascii char. use the fallback_encoding. OK
BUT, if a .pas file contains only ascii char., the fallback_encoding is not used and the file is marked UTF-8. If I add non ascii char. to this file, next time I save it it will encoded in UTF-8.
But actually I couldn’t find a way to resolve cleanly this issue…