From 3b51343ea1942171b0588f4f8367de3bd815e35d Mon Sep 17 00:00:00 2001 From: Justin Goshi Date: Mon, 19 Aug 2019 12:40:50 -0700 Subject: 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 --- Source/cmGlobalVisualStudioGenerator.cxx | 3 +++ 1 file changed, 3 insertions(+) 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"; -- cgit v0.12