diff options
| author | ruki <[email protected]> | 2021-09-22 22:52:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-22 11:26:36 +0800 |
| commit | 5e614774a6cc59832b66d007c59d6da3b77f124b (patch) | |
| tree | 87ff613be08437a46b2bd9e0b7e66b935762e2db /xmake/plugins | |
| parent | d62f35f77a30fe0280086241af2142b282fa1f17 (diff) | |
add bom for vs project generator
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vsfile.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/project/vsxmake/vsxmake.lua | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vsfile.lua b/xmake/plugins/project/vstudio/impl/vsfile.lua index a17384716..040bbee2b 100644 --- a/xmake/plugins/project/vstudio/impl/vsfile.lua +++ b/xmake/plugins/project/vstudio/impl/vsfile.lua @@ -97,7 +97,7 @@ end function open(filepath, mode) -- open it - local file = io.open(filepath, mode) + local file = io.open(filepath, mode, {encoding = "utf8bom"}) -- hook print, printf and write file._print_impl = file.print diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua index 0055aaff2..cc50cb2d3 100644 --- a/xmake/plugins/project/vsxmake/vsxmake.lua +++ b/xmake/plugins/project/vsxmake/vsxmake.lua @@ -167,7 +167,9 @@ function _writefileifneeded(file, content) dprint("skipped file %s since the file has the same content", path.relative(file)) return end - io.writefile(file, content) + -- we need utf8 with bom encoding for unicode + -- @see https://github.com/xmake-io/xmake/issues/1689 + io.writefile(file, content, {encoding = "utf8bom"}) end function _clear_cacheconf() |
