
#15021: ghc-pkg list crashes on Windows when unicode character is in the path -------------------------------------+------------------------------------- Reporter: nh2 | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: ghc-pkg | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: GHC doesn't work | Unknown/Multiple at all | Test Case: Blocked By: | Blocking: Related Tickets: #10762, #15096 | Differential Rev(s): Phab:D4642 Wiki Page: | -------------------------------------+------------------------------------- Comment (by lehins): The quickfix proposed is OK, but it't not enough, since the right way is to alos set the code page to 65001 on Windows so after the utf8 encoding is applied it not only doesn't error out but also actually prints out the correct characters. I was able to get this working to day, will try to add a fix tomorrow. Here is the quickfix proposed by @bgamari in action: {{{ PS C:\phab\ghc-pkg\.stack-work\install\b82bf5d2\bin> .\ghc-pkg.exe list --global-package-db C:\Users\Алексей\ghc-8.4.2\lib\package.conf.d C:\Users\╨É╨╗╨╡╨║╤ü╨╡╨╣\ghc-8.4.2\lib\package.conf.d Cabal-2.2.0.1 Win32-2.6.1.0 array-0.5.2.0 base-4.11.1.0 binary-0.8.5.1 bytestring-0.10.8.2 containers-0.5.11.0 }}} Here is with a bit of extra (patch coming tomorrow, it's too late for me right now to submit anything) {{{ PS C:\phab\ghc-pkg\.stack-work\install\b82bf5d2\bin> .\ghc-pkg.exe list --global-package-db C:\Users\Алексей\ghc-8.4.2\lib\package.conf.d C:\Users\Алексей\ghc-8.4.2\lib\package.conf.d Cabal-2.2.0.1 Win32-2.6.1.0 array-0.5.2.0 base-4.11.1.0 binary-0.8.5.1 bytestring-0.10.8.2 containers-0.5.11.0 deepseq-1.4.3.0 directory-1.3.1.5 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15021#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler