This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  612bb575cbaf3ed9f6acad58a25e54bad09edd18 (commit)
       via  6b74669d508572429314e9522c53374faa0666b8 (commit)
      from  88ee8733112b16d9ab122f25fd4c67eecee7b07e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=612bb575cbaf3ed9f6acad58a25e54bad09edd18
commit 612bb575cbaf3ed9f6acad58a25e54bad09edd18
Merge: 88ee873 6b74669
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Nov 2 09:25:04 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Wed Nov 2 09:25:04 2016 -0400

    Merge topic 'remove-utf8-option' into next
    
    6b74669d Encoding: Remove option to use ANSI code page internally


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b74669d508572429314e9522c53374faa0666b8
commit 6b74669d508572429314e9522c53374faa0666b8
Author:     Clinton Stimpson <clin...@elemtech.com>
AuthorDate: Tue Nov 1 16:35:23 2016 -0600
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Nov 2 09:23:41 2016 -0400

    Encoding: Remove option to use ANSI code page internally
    
    The switch to use UTF-8 encoding has been defaulted to on for quite some
    time since commit v3.2.0-rc1~116^2 (Encoding: Switch to use UTF-8
    internally by default on Windows, 2014-12-26).

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1bc4b4e..a5702e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,12 +66,8 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
   include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
 endif()
 
-# option to set the internal encoding of CMake to UTF-8
-option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally." ON)
-mark_as_advanced(CMAKE_ENCODING_UTF8)
-if(CMAKE_ENCODING_UTF8)
-  set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
-endif()
+# set the internal encoding of CMake to UTF-8
+set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
 
 # option to use COMPONENT with install command
 option(CMake_INSTALL_COMPONENTS "Using components when installing" OFF)
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;
 
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index fad8075..9038469 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -95,10 +95,8 @@ int main(int argc, char** argv)
 
   setlocale(LC_NUMERIC, "C");
 
-#if defined(CMAKE_ENCODING_UTF8)
   QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8");
   QTextCodec::setCodecForLocale(utf8_codec);
-#endif
 
 #if QT_VERSION < 0x050000
   // clean out standard Qt paths for plugins, which we don't use anyway
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 057c6c0..26f1df2 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -20,7 +20,6 @@
 #cmakedefine CMAKE_USE_ELF_PARSER
 #cmakedefine CMAKE_USE_MACH_PARSER
 #cmakedefine CMAKE_USE_LIBUV
-#cmakedefine CMAKE_ENCODING_UTF8
 #cmakedefine CMake_HAVE_CXX_AUTO_PTR
 #cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
 #cmakedefine CMake_HAVE_CXX_NULLPTR
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index ac76191..1bade57 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -59,7 +59,7 @@ static mode_t mode_setuid = S_ISUID;
 static mode_t mode_setgid = S_ISGID;
 #endif
 
-#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8)
+#if defined(_WIN32)
 // libcurl doesn't support file:// urls for unicode filenames on Windows.
 // Convert string from UTF-8 to ACP if this is a file:// URL.
 static std::string fix_file_url_windows(const std::string& url)
@@ -2642,7 +2642,7 @@ bool 
cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
     return false;
   }
 
-#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8)
+#if defined(_WIN32)
   url = fix_file_url_windows(url);
 #endif
 
@@ -2902,7 +2902,7 @@ bool 
cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
 
   unsigned long file_size = cmsys::SystemTools::FileLength(filename);
 
-#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8)
+#if defined(_WIN32)
   url = fix_file_url_windows(url);
 #endif
 
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx 
b/Source/cmGlobalVisualStudio7Generator.cxx
index 773f8a0..c60a1ff 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -731,11 +731,5 @@ bool cmGlobalVisualStudio7Generator::IsDependedOn(
 
 std::string cmGlobalVisualStudio7Generator::Encoding()
 {
-  std::ostringstream encoding;
-#ifdef CMAKE_ENCODING_UTF8
-  encoding << "UTF-8";
-#else
-  encoding << "Windows-1252";
-#endif
-  return encoding.str();
+  return "UTF-8";
 }

-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt                            |    8 ++----
 Source/CPack/WiX/cmWIXSourceWriter.cxx    |   41 +----------------------------
 Source/CPack/WiX/cmWIXSourceWriter.h      |    2 --
 Source/QtDialog/CMakeSetup.cxx            |    2 --
 Source/cmConfigure.cmake.h.in             |    1 -
 Source/cmFileCommand.cxx                  |    6 ++---
 Source/cmGlobalVisualStudio7Generator.cxx |    8 +-----
 7 files changed, 7 insertions(+), 61 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to