force Windows to always use preamble-free UTF8 input encoding (#22934)

* fixes #15770
* When running under the UTF-8 codepage, Powershell subprocesses will fail (eg, Start-Job, others) if the input encoding is using the default BOM preamble. This fix forces it to use no preamble in leaf_exec and win_shell, and includes tests to verify that Start-Job works.
This commit is contained in:
Matt Davis 2017-03-24 00:02:39 -07:00 committed by GitHub
commit e084e8809e
4 changed files with 26 additions and 0 deletions

View file

@ -115,3 +115,13 @@
that:
- "not raw_with_items_result|failed"
- "raw_with_items_result.results|length == 32"
- name: test raw with job to ensure that preamble-free InputEncoding is working
raw: Start-Job { echo yo } | Receive-Job -Wait
register: raw_job_result
- name: check raw with job result
assert:
that:
- raw_job_result | succeeded
- raw_job_result.stdout_lines[0] == 'yo'