diff options
| -rw-r--r-- | .github/workflows/windows.yml | 2 | ||||
| -rw-r--r-- | xmake/modules/private/tools/vstool.lua | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 68f2e55d7..39e29e8dd 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -41,7 +41,7 @@ jobs: # Cache xmake dependencies - name: Retrieve xmake cache for packages - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: xmake-cache key: ${{ matrix.os }}-${{ matrix.arch }} 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 |
