Menu

#1923 buffer-local-property encoding not taken into account in the Templates plugin

open
nobody
None
5
2022-11-15
2022-11-15
No

If you put a buffer-local-property like this :

:encoding=UTF-8:

into a vm template it will not be taken into account when the file will be generated.
The buffer will still be in the native encoding (cp1252 in my Windows 11 for ex.).
This is confusing and I often got caught in this issue.

I found a workaround, I add these 4 lines somewhere in the template :

#beanshell (false)
buffer.setStringProperty(buffer.ENCODING, "UTF-8");
view.getStatus().updateBufferStatus();
#end

Hope it helps.

(jEdit 5.6.0, Templates plugin 5.0.3)

Discussion


Log in to post a comment.