summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/vstudio/impl
diff options
context:
space:
mode:
authorruki <[email protected]>2018-08-30 21:02:14 +0800
committerruki <[email protected]>2018-08-30 00:13:27 +0800
commitfa751b550a8363c6d7afc57891f9b4e0fa7ab826 (patch)
tree09c8ca320506d899d8e0e5af6c402e1ef6bc59f7 /xmake/plugins/project/vstudio/impl
parent066348679895a8812f83369f55bea777714b5a3d (diff)
add string.convert
Diffstat (limited to 'xmake/plugins/project/vstudio/impl')
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_solution.lua6
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua6
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua6
3 files changed, 15 insertions, 3 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua
index ddc34a8c6..b2c9e7705 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua
@@ -103,7 +103,8 @@ function make(vsinfo)
vsinfo.solution_name = project.name() or "vs" .. vsinfo.vstudio_version
-- open solution file
- local slnfile = vsfile.open(path.join(vsinfo.solution_dir, vsinfo.solution_name .. ".sln"), "w")
+ local slnpath = path.join(vsinfo.solution_dir, vsinfo.solution_name .. ".sln")
+ local slnfile = vsfile.open(slnpath, "w")
-- init indent character
vsfile.indentchar('\t')
@@ -119,4 +120,7 @@ function make(vsinfo)
-- exit solution file
slnfile:close()
+
+ -- convert gb2312 to utf8
+ io.writefile(slnpath, io.readfile(slnpath):convert("gb2312", "utf8"))
end
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
index 967c52cb7..7fc12a53a 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -705,7 +705,8 @@ function make(vsinfo, target)
local vcxprojdir = path.join(vsinfo.solution_dir, targetname)
-- open vcxproj file
- local vcxprojfile = vsfile.open(path.join(vcxprojdir, targetname .. ".vcxproj"), "w")
+ local vcxprojpath = path.join(vcxprojdir, targetname .. ".vcxproj")
+ local vcxprojfile = vsfile.open(vcxprojpath, "w")
-- init indent character
vsfile.indentchar(' ')
@@ -727,4 +728,7 @@ function make(vsinfo, target)
-- exit solution file
vcxprojfile:close()
+
+ -- convert gb2312 to utf8
+ io.writefile(vcxprojpath, io.readfile(vcxprojpath):convert("gb2312", "utf8"))
end
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua
index 714c7b788..9bcaad9ec 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua
@@ -137,7 +137,8 @@ function make(vsinfo, target)
local vcxprojdir = path.join(vsinfo.solution_dir, targetname)
-- open vcxproj.filters file
- local filtersfile = vsfile.open(path.join(vcxprojdir, targetname .. ".vcxproj.filters"), "w")
+ local filterspath = path.join(vcxprojdir, targetname .. ".vcxproj.filters")
+ local filtersfile = vsfile.open(filterspath, "w")
-- init indent character
vsfile.indentchar(' ')
@@ -159,4 +160,7 @@ function make(vsinfo, target)
-- exit solution file
filtersfile:close()
+
+ -- convert gb2312 to utf8
+ io.writefile(filterspath, io.readfile(filterspath):convert("gb2312", "utf8"))
end