Forcing the encoding to `UTF-8` is definitely not right, but probably works, because it is equivalent to your current encoding, e.g. CP1252. Let's dig into this. I think we need to do the following:

<pre>
result.force_encoding!('UTF-16LE')
result.encode(Encoding.default_external)
</pre>

like is done for https://github.com/djberg96/win32-dir/blob/ffi/lib/win32/dir.rb#L97