Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix corrupted config file header for non-ASCII package names
The config-state header is a human readable line prepended to the binary serialisation which looks like Saved package config for pkgname-1.2.3 written by Cabal-2.5.0.0 using ghc-8.6 However, the functions generating and parsing this header didn't take into account that package names are not limited to the ASCII subset and blindly used the ByteString `pack` function which truncates away the high bits of the `Char` code point resulting in a corrupted header with a non-sensical package-name. The fix is simply to serialise the package-name with the UTF-8 encoding which works nicely with the rest of the UTF-8 unaware string handling functions. Hence the fix is a lot shorter than this commit message. Fixes haskell#2557
- Loading branch information