diff options
author | Justin Goshi <jgoshi@microsoft.com> | 2019-08-19 19:40:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-20 15:09:31 (GMT) |
commit | 3b51343ea1942171b0588f4f8367de3bd815e35d (patch) | |
tree | db5538ddf67a95d57e24e9d671d012ca902f3452 | |
parent | c41c79285b5ebb7dd914a6e714aa553bb5078641 (diff) | |
download | CMake-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
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 3 |
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"; |