StrictCheck icon indicating copy to clipboard operation
StrictCheck copied to clipboard

Error diagnostic crashes on Windows

Open plaidfinch opened this issue 7 years ago • 3 comments

Via /u/Tarmen, we have a bug report posted on Reddit. The relevant piece seems to be:

...on windows the error reporting breaks with

*** Failed! Falsifiable (after 15 tests and 6 shrinks):
┌──────────────┐   ┌─────────────────────┐
│ Inputs       ├───┤ Demand on result    │
├──────────────┤   ├─────────────────────┤
│ StrictCheckTest.EXE: <stdout>: commitBuffer: invalid argument (invalid character)

I suspect this is due to issues with Unicode text handling. The crash occurs right before StrictCheck would ordinarily print the Unicode bullet character (U+2022).

A search of bug reports seems to indicate this is a locale issue, in particular this StackOverflow answer says that this issue might be resolved by runningsetLocaleEncoding utf8 before printing text. It references the documentation for GHC.IO.Encoding, as noted in part of the Hakyll FAQ.

plaidfinch avatar Jul 01 '18 23:07 plaidfinch

setLocalEncoding utf8 did not fix the issue for me. However running chcp 65001, $OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding or using WSL did. I think this might be ghc beeing too conservative since Powershell can output unicode characters even without the codepage change - it's piping where things would break.

The unicode bullet/arrow is still rendered as a missing character in all fonts I tried, even ones where the equivalent linux version worked. That's only mildly annoying, though, and it turns out the artifacts I saw at first are actually a bug in the neovim terminal emulator in the presence of missing characters.

Tarmean avatar Jul 03 '18 21:07 Tarmean

Hmm, that's frustrating indeed. Perhaps we should detect when we're running on Windows and use different characters. Thanks for the update!

plaidfinch avatar Jul 04 '18 19:07 plaidfinch

@Tarmean, I would like to try and fix this issue, but I don't have access to a Windows license. Would you be willing to help debug this problem?

plaidfinch avatar Oct 13 '18 21:10 plaidfinch