Fix encoding-issues on windows
auto-save buffer on lost focus