Problem with Unicode on Windows

408 views
Skip to first unread message

nexx

unread,
Sep 28, 2012, 1:34:29 PM9/28/12
to hakyll
I try to use Hakyll on Windows 7 64 bit. It seems to work besides
handling non-ascii characters. E.g. … from the index.html from
the simpleblog example.

When such a character is processed, the site generation process stops
with "commitBuffer: invalid argument (invalid character)"

PS Y:\blog\learn\hakyll-examples\simpleblog> .\site.exe rebuild
Removing _site...
Removing _cache...
Initialising
[ 0ms] Creating store
[ 2ms] Creating provider
Adding new compilers
Compiling css/default.css
[ 0ms] Total compile time
[ 1ms] Routing to css/default.css
Compiling templates/default.html
[ ] Checking cache: modified
[ -2ms] Total compile time
Compiling templates/post.html
[ ] Checking cache: modified
[ -1ms] Total compile time
Compiling posts/2009-11-05-a-first-post.markdown
[ ] Checking cache: modified
[ 2ms] Total compile time
[ 1ms] Routing to posts/2009-11-05-a-first-post.html
Compiling posts/2009-11-10-another-post.markdown
[ ] Checking cache: modified
[ -1ms] Total compile time
[ 2ms] Routing to posts/2009-11-10-another-post.html
Compiling posts/2009-11-28-a-third-post.markdown
[ ] Checking cache: modified
[ -1ms] Total compile time
[ 1ms] Routing to posts/2009-11-28-a-third-post.html
Compiling posts/2009-12-04-this-blog-aint-dead.markdown
[ ] Checking cache: modified
[ 0ms] Total compile time
[ 1ms] Routing to posts/2009-12-04-this-blog-aint-dead.html
Compiling posts/2009-12-23-almost-christmas.markdown
[ ] Checking cache: modified
[ 1ms] Total compile time
[ -2ms] Routing to posts/2009-12-23-almost-christmas.html
Compiling templates/index.html
[ ] Checking cache: modified
site.exe: _site\index.html: commitBuffer: invalid argument (invalid
character)
[ -2ms] Total compile time

I tried to set the LANG and LC_CTYPE environment variables to multiple
values (including C, en, en_US, en_US.utf8, en_US.UTF-8 and
de_DE.UTF-8), but non helped.

Any more suggestions to solve this problem?

Jasper Van der Jeugt

unread,
Sep 28, 2012, 7:39:26 PM9/28/12
to hak...@googlegroups.com
 Hello,

What happens if you just try to stick some Unicode in a file? E.g.

    main :: IO ()
    main = writeFile "test.txt" "åęüż"

This will tell if it's a Hakyll/Pandoc-specific problem.

Peace,
Jasper
--
Peace,
Jasper

howard_...@yahoo.com

unread,
Mar 24, 2014, 7:44:09 PM3/24/14
to hak...@googlegroups.com, loewe....@googlemail.com
Thanks, Istvan! Your suggestion worked for me on Win 7 32.

Howard

On Friday, November 16, 2012 5:46:43 AM UTC-8, pestaa wrote:
I tried every suggestion above and possibly a lot more, but this is what worked for me (Win 7 x64):

import GHC.IO.Encoding
...
main = do
  setLocaleEncoding utf8
  setFileSystemEncoding utf8
  setForeignEncoding utf8
  hakyllWith ...
Reply all
Reply to author
Forward
0 new messages