Commit b00deb7c authored by Duncan Coutts's avatar Duncan Coutts Committed by Edward Z. Yang
Browse files

Fix string conversions in ghc-pkg to be correct w.r.t. Unicode

Similar change to that on the ghc library side in the previous patch.
The BinaryStringRep class has to use a ByteString in UTF8 encoding.
parent c72efd7c
......@@ -24,6 +24,7 @@ import Distribution.ModuleExport
import Distribution.Package hiding (depends)
import Distribution.Text
import Distribution.Version
import Distribution.Simple.Utils (fromUTF8, toUTF8)
import System.FilePath as FilePath
import qualified System.FilePath.Posix as FilePath.Posix
import System.Process
......@@ -1075,12 +1076,12 @@ convertPackageInfoToCacheFormat pkg =
}
instance GhcPkg.BinaryStringRep ModuleName where
fromStringRep = ModuleName.fromString . BS.unpack
toStringRep = BS.pack . display
fromStringRep = ModuleName.fromString . fromUTF8 . BS.unpack
toStringRep = BS.pack . toUTF8 . display
instance GhcPkg.BinaryStringRep String where
fromStringRep = BS.unpack
toStringRep = BS.pack
fromStringRep = fromUTF8 . BS.unpack
toStringRep = BS.pack . toUTF8
-- -----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment