-- TIME_STAMP 2021-04-30 10:20:21 -- coding:utf-8 --[[ In "SciTEUser.properties" set output.code.page for file types. If not set: "0" is default. #~ used with file "SwitchOutputCodepage.lua" output.cp.au3=0 output.cp.lua=65001 ]] SwitchCP = EventClass:new(Common) local bDEBUG = false SwitchCP.Switch = function(self, _file) local cpOutput, ext = props['output.code.page'], props['FileExt']:lower() local cpRequired = props['output.cp.'..ext] if cpRequired == '' then cpRequired = '0' end if cpOutput ~= cpRequired then props['output.code.page'] = cpRequired if bDEBUG then print(_file, 'output.code.page: '..cpOutput..' --> '..cpRequired) end end return nil end SwitchCP.OnOpen = function(self, _file) return self:Switch(_file) end SwitchCP.OnSwitchFile = function(self, _file) return self:Switch(_file) end SwitchCP.OnSave = function(self, _file) return self:Switch(_file) end