This transcript shows a really strange side effect, and surely it's a bug this happens:
*Database.Fsck Database.Handle> hSetEncoding stderr utf16
*Database.Fsck Database.Handle> hGetEncoding stderr
Just UTF-16
*Database.Fsck Database.Handle> initDb "/tmp/testdb" $ void $ runMigrationSilent migrateFsck
*Database.Fsck Database.Handle> hGetEncoding stderr
Just UTF-8
stdout's encoding is not effected, only stderr.
I'm using persistent-2.1.6 and persistent-sqlite-2.1.4.2, with ghc 7.8.4.
In case it matters somehow, here's the TH code that generated the migration:
share [mkPersist sqlSettings, mkMigrate "migrateFsck"] [persistLowerCase|
Fscked
key SKey
UniqueKey key
|]
newtype SKey = SKey String
deriving (Show, Read)