summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-21 00:40:56 +0800
committerruki <[email protected]>2019-08-20 22:05:38 +0800
commit7ce304f9ee9946471d4ad11e78ea25149a05483f (patch)
tree7edc43a6b512306669418b7cea74a3c7e4c6d7b1
parentf0edb8798d3c425249792c735eec7655c5eb2b62 (diff)
add utf16le encoding when reading outfile
-rw-r--r--xmake/modules/private/tools/vstool.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/modules/private/tools/vstool.lua b/xmake/modules/private/tools/vstool.lua
index 83539d301..05c7a16b6 100644
--- a/xmake/modules/private/tools/vstool.lua
+++ b/xmake/modules/private/tools/vstool.lua
@@ -43,7 +43,7 @@ function runv(program, argv, opt)
if ok ~= 0 then
-- read errors
- local outdata = os.isfile(outpath) and io.readfile(outpath) or nil
+ local outdata = os.isfile(outpath) and io.readfile(outpath, {encoding = "utf16le"}) or nil
local errdata = os.isfile(errpath) and io.readfile(errpath) or nil
local errors = errdata or ""
if #errors:trim() == 0 then
@@ -92,7 +92,7 @@ function iorunv(program, argv, opt)
-- get output and error data
outfile:close()
- local outdata = os.isfile(outpath) and io.readfile(outpath) or nil
+ local outdata = os.isfile(outpath) and io.readfile(outpath, {encoding = "utf16le"}) or nil
local errdata = os.isfile(errpath) and io.readfile(errpath) or nil
-- remove the temporary output and error file