Encoding: Fix potential encoding issues with libarchive on Windows.

Because the 8bit string encoding in libarchive can be different than
the 8bit string encoding in CMake, change to call the wide version
of libarchive functions.  They are different if CMake is configured
to use UTF-8 as the internal encoding.

Create helper functions for some libarchive calls to use wstring
internally on platforms supporting it.
Merge topic 'libarchive-encoding' into next

71c981a2 Encoding: Fix potential encoding issues with libarchive on Windows.