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  39ec090ac4c4389a761fda0ff913e3267c2839e3 (commit)
       via  baead1e2a8ff7938f6be9c5fc01762edddd2ace9 (commit)
      from  77b88ee5b8fa9560310b6b4c6975639809caf451 (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=39ec090ac4c4389a761fda0ff913e3267c2839e3
commit 39ec090ac4c4389a761fda0ff913e3267c2839e3
Merge: 77b88ee baead1e
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Nov 2 10:52:17 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Wed Nov 2 10:52:17 2016 -0400

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=baead1e2a8ff7938f6be9c5fc01762edddd2ace9
commit baead1e2a8ff7938f6be9c5fc01762edddd2ace9
Author:     Clinton Stimpson <clin...@elemtech.com>
AuthorDate: Tue Nov 1 16:35:23 2016 -0600
Commit:     Clinton Stimpson <clin...@elemtech.com>
CommitDate: Wed Nov 2 08:48:34 2016 -0600

    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/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;
 
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:


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

Reply via email to