diff --git a/plugins/connection/libvirt_qemu.py b/plugins/connection/libvirt_qemu.py index 9e5271f..c9ed52f 100644 --- a/plugins/connection/libvirt_qemu.py +++ b/plugins/connection/libvirt_qemu.py @@ -160,6 +160,10 @@ def exec_command(self, cmd, in_data=None, sudoable=True): # prompt that will not occur sudoable = False + # Make sure our first command is to set the console encoding to + # utf-8, this must be done via chcp to get utf-8 (65001) + cmd = ' '.join(["chcp.com", "65001", self._shell._SHELL_REDIRECT_ALLNULL, self._shell._SHELL_AND, cmd]) + # Generate powershell commands cmd_args_list = self._shell._encode_script(cmd, as_list=True, strict_mode=False, preserve_rc=False)