Original author: firstname.lastname@example.org (December 18, 2010 20:56:50)
Current hledger built with ghc >= 6.12 is supposed to use the configured locale to decode non-ascii data in journal files. We have found and documented some quirks with this (locale must be installed, locale name must be exact on some platforms) but T. Daucourt is still seeing problems with this:
$ locale -a
$ LANG=fr_FR.utf8 ~/hledger-0.13-linux-x86_64 --verbose --debug bal -f hledger_test_09
hledger-0.13-linux-x86_64: hledger_test_09: hGetContents: invalid argument (Invalid or incomplete multibyte or wide character)
I can't reproduce the problem. Apparently using the same 0.13 64-bit linux binary from http://hledger.org/DOWNLOADS.html , same ubuntu version, same locale and same journal file, it works for me:
$ locale -a
$ LANG=fr_FR.utf8 bin/hledger-0.13-linux-x86_64 --verbose --debug bal -f tdaucourt-test-09.journal
Original issue: http://code.google.com/p/hledger/issues/detail?id=34
From email@example.com on December 18, 2010 21:15:17
More: in the above example, the test file is a simple utf8-encoded journal. A file containing a single utf8-encoded character should be enough to test this. I'd really like to understand why this fails for him, before I go fixing stuff.
However, it does seem that going back to requiring that input be utf8-encoded (like pandoc) is the right thing to do. I think I moved away from that only because it seemed "the GHC 6.12 way", but it seems locale-sensitivity basically creates fragility for users. If someone wants to add a --use-locale option later, I'd be happy with that.
From firstname.lastname@example.org on January 21, 2011 01:51:59
Fixed for 0.14, we now always read and write utf-8 regardless of locale.