mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-14 18:51:42 -06:00
execute_process: Document and test ENCODING default
The default was originally AUTO in commit2ed473b3b8(execute_process: Add ENCODING option for Windows child process output, 2016-11-23, v3.8.0-rc1~232^2) but was changed back to NONE by commit07c3380a6e(execute_process: Restore no-decoding default behavior, 2017-02-13, v3.8.0-rc2~26^2) for CMake 3.8. Later it was accidentally changed back to AUTO by commitb783e62533(cmExecuteProcessCommand: Port to cmArgumentParser, 2019-03-25, v3.15.0-rc1~270^2) in CMake 3.15 but the documentation was not updated. Document the current default, AUTO, and add a test case to verify it. Issue: #26262
This commit is contained in:
@@ -140,12 +140,15 @@ Options:
|
||||
``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.
|
||||
|
||||
This was the default in CMake 3.14 and older.
|
||||
|
||||
``AUTO``
|
||||
Use the current active console's codepage or if that isn't
|
||||
available then use ANSI.
|
||||
|
||||
This is the default since CMake 3.15.
|
||||
|
||||
``ANSI``
|
||||
Use the ANSI codepage.
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Chinese
|
||||
注意
|
||||
3
Tests/RunCMake/execute_process/EncodingDefault.cmake
Normal file
3
Tests/RunCMake/execute_process/EncodingDefault.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
# No explicit ENCODING option; fall back to default.
|
||||
set(CODEPAGE 54936)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/Encoding.cmake)
|
||||
@@ -9,6 +9,7 @@ run_cmake_command(MergeOutputVars ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/Mer
|
||||
|
||||
run_cmake(EncodingMissing)
|
||||
if(TEST_ENCODING_EXE)
|
||||
run_cmake_script(EncodingDefault -DTEST_ENCODING_EXE=${TEST_ENCODING_EXE})
|
||||
run_cmake_script(EncodingAUTO -DTEST_ENCODING_EXE=${TEST_ENCODING_EXE})
|
||||
run_cmake_script(EncodingUTF-8 -DTEST_ENCODING_EXE=${TEST_ENCODING_EXE})
|
||||
run_cmake_script(EncodingUTF8 -DTEST_ENCODING_EXE=${TEST_ENCODING_EXE})
|
||||
|
||||
Reference in New Issue
Block a user