<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">Hello Haskellers,</p>
<p style="margin:0px 0px 1.2em!important">Currently, I’m working on <a href="https://github.com/haskell/haddock/pull/566">this issue</a>,<br>where haddock crashes when printing <a href="http://www.fileformat.info/info/unicode/char/2022/index.htm">the Unicode “bullet character”</a> on stderr whose character encoding is not UTF-8.</p>
<p style="margin:0px 0px 1.2em!important">In the beforementioned pull request, I just added <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">hSetEncoding stderr utf8</code> as a quick-and-dirty workaround.<br>But GHC actually doesn’t do so: GHC prints “?” instead of the bullet character when stderr is not Unicode-compatible.</p>
<p style="margin:0px 0px 1.2em!important">So, I believe there’s a better way to handle the case, and GHC knows it.<br>Then, how does GHC detect the handle’s character encoding and convert incompatible characters (such as the bullet character) into “?” to avoid the error?<br>I couldn’t get it by reading the source of GHC a bit.</p>
<p style="margin:0px 0px 1.2em!important">Thanks in advance!</p>
<div title="MDH:PGRpdiBkaXI9ImF1dG8iPjxkaXYgZGlyPSJhdXRvIj5IZWxsbyBIYXNrZWxsZXJzLDwvZGl2Pjxk
aXYgZGlyPSJhdXRvIj48YnI+PC9kaXY+PGRpdiBkaXI9ImF1dG8iPkN1cnJlbnRseSwgSSdtIHdv
cmtpbmcgb24gW3RoaXMgaXNzdWVdKDxhIGhyZWY9Imh0dHBzOi8vZ2l0aHViLmNvbS9oYXNrZWxs
L2hhZGRvY2svcHVsbC81NjYiIHRhcmdldD0iX2JsYW5rIj5odHRwczovL2dpdGh1Yi5jb20vaGFz
a2VsbC9oYWQ8d2JyPmRvY2svcHVsbC81NjY8L2E+KSw8L2Rpdj48ZGl2IGRpcj0iYXV0byI+d2hl
cmUgaGFkZG9jayBjcmFzaGVzIHdoZW4gcHJpbnRpbmcgW3RoZSBVbmljb2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