Merge pull request #1431 from Haacked/windows-code-page-fix

Set the codepage to 65001 before generating