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)