Sfoglia il codice sorgente

Merge topic 'execute_process-default-encoding'

07c3380a execute_process: Restore no-decoding default behavior
4168bc18 Help: Improve execute_process ENCODING option documentation
Brad King 9 anni fa
parent
commit
31e96ccca2
2 ha cambiato i file con 16 aggiunte e 5 eliminazioni
  1. 15 4
      Help/command/execute_process.rst
  2. 1 1
      Source/cmExecuteProcessCommand.cxx

+ 15 - 4
Help/command/execute_process.rst

@@ -70,10 +70,21 @@ Options:
 ``ENCODING <name>``
 ``ENCODING <name>``
  On Windows, the encoding that is used to decode output from the process.
  On Windows, the encoding that is used to decode output from the process.
  Ignored on other platforms.
  Ignored on other platforms.
- Valid encoding names are: ``AUTO`` (the default), ``NONE``, ``UTF8``,
- ``ANSI`` and ``OEM``.
- ``AUTO`` encoding means current active console's codepage will be used
- or if that isn't available then ``ANSI`` codepage will be used.
+ Valid encoding names are:
+
+ ``NONE``
+   Perform no decoding.  This assumes that the process output is encoded
+   in the same way as CMake's internal encoding (UTF-8).
+   This is the default.
+ ``AUTO``
+   Use the current active console's codepage or if that isn't
+   available then use ANSI.
+ ``ANSI``
+   Use the ANSI codepage.
+ ``OEM``
+   Use the original equipment manufacturer (OEM) code page.
+ ``UTF8``
+   Use the UTF-8 codepage.
 
 
 If more than one ``OUTPUT_*`` or ``ERROR_*`` option is given for the
 If more than one ``OUTPUT_*`` or ``ERROR_*`` option is given for the
 same pipe the precedence is not specified.
 same pipe the precedence is not specified.

+ 1 - 1
Source/cmExecuteProcessCommand.cxx

@@ -47,7 +47,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
   std::string error_variable;
   std::string error_variable;
   std::string result_variable;
   std::string result_variable;
   std::string working_directory;
   std::string working_directory;
-  cmProcessOutput::Encoding encoding = cmProcessOutput::Auto;
+  cmProcessOutput::Encoding encoding = cmProcessOutput::None;
   for (size_t i = 0; i < args.size(); ++i) {
   for (size_t i = 0; i < args.size(); ++i) {
     if (args[i] == "COMMAND") {
     if (args[i] == "COMMAND") {
       doing_command = true;
       doing_command = true;