I'm facing issue with
import Language.Haskell.TH.Quote (QuasiQuoter, quoteFile)
import Text.Shakespeare.Text (st)
sfFile :: QuasiQuoter
stFile = quoteFile st
Exception when trying to run compile-time code:
test-file.md: hGetContents: invalid argument (invalid byte sequence)
import System.IO (IOMode(..), hGetContents, openFile, openBinaryFile, utf8)
do h <- openBinaryFile "test-file.md" ReadMode
-- Binary read works fine out-of-box.
h' <- openFile "test-file.md" ReadMode
hSetEncoding h' utf8
-- This works only if encoding is explicitly set, otherwise
-- it gives "invalid byte sequence" error at run-time
$ file -bi test-file.md
Finally, I've found that my virtual locale was not properly set, e.g.
locale command showed me that all
LANG variables are set to
LANG variable to command is the quickest workaround (bash example):
export LANG=en_US.uft8 cabal build
However, likely you need to have
en_US locale installed, Debian manual configuration is:
/etc/locale.gen, append new line
locale-gento generate locales.
Debian locales wiki1
P.S. My default Debian Wheezy installation had
C.UTF-8 in default locales list, so I believe in purposes of minimalism is it possible use it rather than install additional English locale, but I didn't test it by myself.