Merge pull request #191 from TheNain38/patch-1

coffee.wsf: Encode the resulting file in UTF-8 without BOM
This commit is contained in:
ZeroNet 2015-10-19 15:13:01 +02:00
commit 7ec6962997
1 changed files with 13 additions and 3 deletions

View File

@ -82,12 +82,22 @@ function readUtf8(filename) {
function writeUtf8(filename, text) {
var stream = new ActiveXObject("ADODB.Stream");
stream.Open();
stream.Type = 2; // Text
stream.Charset = 'utf-8';
stream.Charset = "utf-8";
stream.Open();
stream.WriteText(text);
stream.Position = 0;
stream.Type = 1; // Binary
stream.Position = 3;
var binary = stream.Read();
stream.Close();
stream.Open();
stream.Type = 1; // Binary
stream.Write(binary);
stream.SaveToFile(filename, 2);
stream.Close();
}
</script>
</job>
</job>