summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-11 17:00:26 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-01-11 17:00:26 (GMT)
commit20d60c636116c55bfeaa7ebd02045fafe0b96808 (patch)
tree7d39d21d05984ee148cc34943ed1be961532f3fe
parent775fb2e0b03772f08b5740ad5463f849109f0c7f (diff)
parent61cf781a6216c55a60fb73d4fb5fab76b1e7fc34 (diff)
downloadCMake-20d60c636116c55bfeaa7ebd02045fafe0b96808.zip
CMake-20d60c636116c55bfeaa7ebd02045fafe0b96808.tar.gz
CMake-20d60c636116c55bfeaa7ebd02045fafe0b96808.tar.bz2
Merge topic 'sln-bom'
61cf781a Encoding: Write Visual Studio solution file with BOM.
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx5
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx5
2 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index a67a649..64f9cee 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -93,6 +93,11 @@ void cmGlobalVisualStudio71Generator
cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators)
{
+#ifdef CMAKE_ENCODING_UTF8
+ // Add UTF-8 BOM for .sln file to indicate encoding
+ const unsigned char utf8_bom[3] = {0xEF,0xBB,0xBF};
+ fout.write(reinterpret_cast<const char*>(utf8_bom), 3);
+#endif
// Write out the header for a SLN file
this->WriteSLNHeader(fout);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 401e475..0eb7d2c 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -558,6 +558,11 @@ void cmGlobalVisualStudio7Generator
cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators)
{
+#ifdef CMAKE_ENCODING_UTF8
+ // Add UTF-8 BOM for .sln file to indicate encoding
+ const unsigned char utf8_bom[3] = {0xEF,0xBB,0xBF};
+ fout.write(reinterpret_cast<const char*>(utf8_bom), 3);
+#endif
// Write out the header for a SLN file
this->WriteSLNHeader(fout);