diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2015-03-27 11:22:15 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2015-03-27 11:22:15 (GMT) |
commit | 98a3b2e29ece5195e7948681a410bc5fae880a23 (patch) | |
tree | 571243d44b4bdfbb660e6fad7e1abc6b03e66ccb /Source/CPack/WiX/cmWIXSourceWriter.cxx | |
parent | 685d179b8b8e0f0b98dbfd227f6ccd88b17749b0 (diff) | |
download | CMake-98a3b2e29ece5195e7948681a410bc5fae880a23.zip CMake-98a3b2e29ece5195e7948681a410bc5fae880a23.tar.gz CMake-98a3b2e29ece5195e7948681a410bc5fae880a23.tar.bz2 |
CPackWIX: Omit codepage conversion when internal encoding is already UTF-8.
Diffstat (limited to 'Source/CPack/WiX/cmWIXSourceWriter.cxx')
-rw-r--r-- | Source/CPack/WiX/cmWIXSourceWriter.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index aad19da..219fca8 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -10,6 +10,8 @@ See the License for more information. ============================================================================*/ +#include "cmStandardIncludes.h" + #include "cmWIXSourceWriter.h" #include <CPack/cmCPackGenerator.h> @@ -118,7 +120,7 @@ void cmWIXSourceWriter::AddProcessingInstruction( void cmWIXSourceWriter::AddAttribute( std::string const& key, std::string const& value) { - std::string utf8 = WindowsCodepageToUtf8(value); + std::string utf8 = CMakeEncodingToUtf8(value); File << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"'; } @@ -132,8 +134,11 @@ void cmWIXSourceWriter::AddAttributeUnlessEmpty( } } -std::string cmWIXSourceWriter::WindowsCodepageToUtf8(std::string const& value) +std::string cmWIXSourceWriter::CMakeEncodingToUtf8(std::string const& value) { +#ifdef CMAKE_ENCODING_UTF8 + return value; +#else if(value.empty()) { return std::string(); @@ -167,6 +172,7 @@ std::string cmWIXSourceWriter::WindowsCodepageToUtf8(std::string const& value) &utf8[0], static_cast<int>(utf8.size()), 0, 0); return std::string(&utf8[0], utf8.size()); +#endif } |