Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Avoid "invalid argument (invalid character)" on non-unicode Windows (#…
Browse files Browse the repository at this point in the history
…892)

Steps to reproduce and the error message
====

```
> stack haddock basement
... snip ...
    Warning: 'A' is out of scope.
    Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character)
```

Environment
====

OS: Windows 10 ver. 1709
haddock: [HEAD of ghc-8.4 when I reproduce the error](532b209). (I had to use this version to avoid another probrem already fixed in HEAD)
GHC: 8.4.3
stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2

Related pull request
====

#566
  • Loading branch information
igrep authored and alanz committed Mar 25, 2020
1 parent 691f1f1 commit a1cb376
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions haddock-api/src/Haddock/Interface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ processModules
processModules verbosity modules flags extIfaces = do
#if defined(mingw32_HOST_OS)
-- Avoid internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows
liftIO $ hSetEncoding stdout $ mkLocaleEncoding TransliterateCodingFailure
liftIO $ hSetEncoding stderr $ mkLocaleEncoding TransliterateCodingFailure
#endif

Expand Down

0 comments on commit a1cb376

Please sign in to comment.