Saving code uses wxConvCurrent
, so you could try setting it to wxConvUTF8
to ensure that UTF-8 is used even when it's not the encoding of the current locale (which is never the case under Windows).
Unfortunately I'm not sure if you can change wxConvCurrent
from Python. If you can't, the simplest solution would probably be to just write wxStyledTextCtrl::GetValue()
to a file yourself instead of relying on its SaveFile()
method. Don't forget to call SetSavePoint()
after saving successfully if you do this.