summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorJustin Goshi <jgoshi@microsoft.com>2019-08-19 19:40:50 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-20 15:09:31 (GMT)
commit3b51343ea1942171b0588f4f8367de3bd815e35d (patch)
treedb5538ddf67a95d57e24e9d671d012ca902f3452 /Source/cmGlobalVisualStudioGenerator.cxx
parentc41c79285b5ebb7dd914a6e714aa553bb5078641 (diff)
downloadCMake-3b51343ea1942171b0588f4f8367de3bd815e35d.zip
CMake-3b51343ea1942171b0588f4f8367de3bd815e35d.tar.gz
CMake-3b51343ea1942171b0588f4f8367de3bd815e35d.tar.bz2
VS: Emit UTF-8 BOM for generated solution files
We write UTF-8-encoded content to the `.sln` files, so tell VS to read them as such. Fixes: #19594
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index ba541a9..cdb0b5f 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -104,6 +104,9 @@ const char* cmGlobalVisualStudioGenerator::GetIDEVersion() const
void cmGlobalVisualStudioGenerator::WriteSLNHeader(std::ostream& fout)
{
+ char utf8bom[] = { char(0xEF), char(0xBB), char(0xBF) };
+ fout.write(utf8bom, 3);
+
switch (this->Version) {
case cmGlobalVisualStudioGenerator::VS9:
fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n";