fix ByteString conversion on windows

the encode' and decode' functions on Windows should not apply the
filesystem encoding, which does not work there. Instead, convert to and
from UTF-8.

Also, avoid exporting encodeW8 and decodeW8. Both use the filesystem
encoding, so won't work as expected on windows.
This commit is contained in:
Joey Hess 2019-12-18 13:26:06 -04:00
parent 0246ecbe94
commit 322c542b5c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 23 additions and 8 deletions

View file

@ -258,7 +258,7 @@ commandMeter' progressparser oh meterupdate cmd params =
unless (quietMode oh) $ do
S.hPut stdout b
hFlush stdout
let s = encodeW8 (S.unpack b)
let s = decodeBS b
let (mbytes, buf') = progressparser (buf++s)
case mbytes of
Nothing -> feedprogress prev buf' h