diff options
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXSourceWriter.cxx | 41 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXSourceWriter.h | 2 |
3 files changed, 2 insertions, 44 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 5320449..4c8abd9 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -410,8 +410,7 @@ void cmCPackWIXGenerator::AddDefinition(cmWIXSourceWriter& source, std::ostringstream tmp; tmp << name << "=\"" << value << '"'; - source.AddProcessingInstruction( - "define", cmWIXSourceWriter::CMakeEncodingToUtf8(tmp.str())); + source.AddProcessingInstruction("define", tmp.str()); } bool cmCPackWIXGenerator::CreateWiXSourceFiles() diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index a8b0d7c..b434334 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -117,9 +117,7 @@ void cmWIXSourceWriter::AddProcessingInstruction(std::string const& target, void cmWIXSourceWriter::AddAttribute(std::string const& key, std::string const& value) { - std::string utf8 = CMakeEncodingToUtf8(value); - - File << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"'; + File << " " << key << "=\"" << EscapeAttributeValue(value) << '"'; } void cmWIXSourceWriter::AddAttributeUnlessEmpty(std::string const& key, @@ -130,43 +128,6 @@ void cmWIXSourceWriter::AddAttributeUnlessEmpty(std::string const& key, } } -std::string cmWIXSourceWriter::CMakeEncodingToUtf8(std::string const& value) -{ -#ifdef CMAKE_ENCODING_UTF8 - return value; -#else - if (value.empty()) { - return std::string(); - } - - int characterCount = MultiByteToWideChar( - CP_ACP, 0, value.c_str(), static_cast<int>(value.size()), 0, 0); - - if (characterCount == 0) { - return std::string(); - } - - std::vector<wchar_t> utf16(characterCount); - - MultiByteToWideChar(CP_ACP, 0, value.c_str(), static_cast<int>(value.size()), - &utf16[0], static_cast<int>(utf16.size())); - - int utf8ByteCount = WideCharToMultiByte( - CP_UTF8, 0, &utf16[0], static_cast<int>(utf16.size()), 0, 0, 0, 0); - - if (utf8ByteCount == 0) { - return std::string(); - } - - std::vector<char> utf8(utf8ByteCount); - - WideCharToMultiByte(CP_UTF8, 0, &utf16[0], static_cast<int>(utf16.size()), - &utf8[0], static_cast<int>(utf8.size()), 0, 0); - - return std::string(&utf8[0], utf8.size()); -#endif -} - std::string cmWIXSourceWriter::CreateGuidFromComponentId( std::string const& componentId) { diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h index b5c06ab..45aefe5 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.h +++ b/Source/CPack/WiX/cmWIXSourceWriter.h @@ -50,8 +50,6 @@ public: std::string CreateGuidFromComponentId(std::string const& componentId); - static std::string CMakeEncodingToUtf8(std::string const& value); - protected: cmCPackLog* Logger; |