diff options
author | Stuart Preston <stuart@chef.io> | 2018-06-19 11:40:38 +0100 |
---|---|---|
committer | Stuart Preston <stuart@chef.io> | 2018-06-19 11:40:38 +0100 |
commit | 7b0577496c540c85772fd9284ede3f963337666f (patch) | |
tree | 9b9db97c0343ee312c3e05a7def11e54906f3905 /lib/chef/win32 | |
parent | fb7af56751a240bb66de650319375d1eb91460fa (diff) | |
download | chef-7b0577496c540c85772fd9284ede3f963337666f.tar.gz |
powershell_exec uses FFI instead of COM
Signed-off-by: Stuart Preston <stuart@chef.io>
Diffstat (limited to 'lib/chef/win32')
-rw-r--r-- | lib/chef/win32/unicode.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/chef/win32/unicode.rb b/lib/chef/win32/unicode.rb index dd5a197f71..033569f731 100644 --- a/lib/chef/win32/unicode.rb +++ b/lib/chef/win32/unicode.rb @@ -48,6 +48,12 @@ module FFI wide_to_utf8(get_bytes(0, num_wchars * 2)) end + + def read_utf16string + offset = 0 + offset += 2 while get_bytes(offset, 2) != "\x00\x00" + get_bytes(0, offset).force_encoding("utf-16le").encode("utf-8") + end end end |