silently icon indicating copy to clipboard operation
silently copied to clipboard

loses encoding of silenced handles

Open joeyh opened this issue 9 years ago • 1 comments

ghci> hSetEncoding stderr utf16 ghci> hGetEncoding stderr Just UTF-16 ghci> hSilence [stderr] $ print "hi" "hi" ghci> hGetEncoding stderr Just UTF-8

So, encoding was UTF-16, but after stderr was closed and reopened, went back to the default UTF-8.

This is a bad and unexpected side effect. Especially when a library is using silently internally, as in https://github.com/yesodweb/persistent/issues/474

I think it can easily be fixed by getting the old encoding, and restoring it when re-opening the handle.

joeyh avatar Dec 22 '16 18:12 joeyh

@joeyh Thanks for bringing this up and sorry for the late reply. Patches welcome!

sol avatar Jan 08 '17 00:01 sol