summaryrefslogtreecommitdiff
path: root/xmake/modules/private/tools/vstool.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-03-05 22:46:46 +0800
committerruki <[email protected]>2025-03-05 22:46:46 +0800
commitabc89af3c14121a048efd346b58c538b7ef90d6f (patch)
tree4e62b3e09735a9cce9191411adfa43cc7fb942d7 /xmake/modules/private/tools/vstool.lua
parent4a7fa4c90ca066bb67c7f31e0023efd1c6be2bbf (diff)
fix wine/cl output encoding #6191
Diffstat (limited to 'xmake/modules/private/tools/vstool.lua')
-rw-r--r--xmake/modules/private/tools/vstool.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/modules/private/tools/vstool.lua b/xmake/modules/private/tools/vstool.lua
index 56601ba6c..d687bb750 100644
--- a/xmake/modules/private/tools/vstool.lua
+++ b/xmake/modules/private/tools/vstool.lua
@@ -51,7 +51,8 @@ function runv(program, argv, opt)
if ok ~= 0 then
-- read errors
- local outdata = os.isfile(outpath) and io.readfile(outpath, {encoding = "utf16le"}) or nil
+ local encoding = is_host("windows") and "utf16le" or nil
+ local outdata = os.isfile(outpath) and io.readfile(outpath, {encoding = encoding}) or nil
local errdata = os.isfile(errpath) and io.readfile(errpath) or nil
local errors = errdata or ""
if #errors:trim() == 0 then
@@ -116,7 +117,8 @@ function iorunv(program, argv, opt)
-- get output and error data
outfile:close()
- local outdata = os.isfile(outpath) and io.readfile(outpath, {encoding = "utf16le"}) or nil
+ local encoding = is_host("windows") and "utf16le" or nil
+ local outdata = os.isfile(outpath) and io.readfile(outpath, {encoding = encoding}) or nil
local errdata = os.isfile(errpath) and io.readfile(errpath) or nil
-- remove the temporary output and error file