How to work around GHC bug

Volker Wysk pf3 at
Wed Mar 14 18:14:43 CET 2012

Am Mittwoch 14 März 2012, 16:19:33 schrieben Sie:
> Quoth Volker Wysk <pf3 at>,
> > I'll report this as a bug in the GHC Trac. But for now, I need to work
> > around the problem somehow. The encoders in GHC.IO.Encoding all work on
> > buffers. How do I recode the command line, in order to get proper
> > Unicode strings?
> Data.Text might work for you.  I'm not guaranteeing that you'll get
> a "proper Unicode string" out of this, but you'll get a String with
> one (LATIN-1) value per character:
> import qualified Data.ByteString.Char8 as P
> import Data.Text.Encoding (decodeUtf8)
> import qualified Data.Text as T
> let arghs = ["\195\164"]
> let args = map (T.unpack . decodeUtf8 . P.pack) arghs

Yes, this works! Thanks!


More information about the Glasgow-haskell-users mailing list