1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 20:46:37 +08:00

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
This commit is contained in:
Justin Goshi
2019-08-19 12:40:50 -07:00
committed by Brad King
parent c41c79285b
commit 3b51343ea1

View File

@@ -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";