Hi Henry, Am Donnerstag, den 08.04.2010, 11:33 +0200 schrieb henry atting: > On Do, Apr 08 2010, Kari Pahula wrote: > > On Wed, Apr 07, 2010 at 04:31:07PM +0200, henry atting wrote: > >> BTW, on the hledger website are some older builds to download which are > >> working fine. > > > > Could you please try narrowing down which was the last version that > > worked correctly for you? It'd help if I had some simple test case > > for this. It's something more subtle if putStrLn indeed outputs > > correct UTF-8. > > The version which works (downloaded as binary from > http://hledger.org/binaries/) is: hledger-0.7 with vty > > The current version that does not work correctly (installed with `cabal > install`) is: hledger-0.8 with vty > > If I use the simple ncurses ui the euro sign and umlauts are displayed > correctly. (in both versions)
I assume that hledger-0.7 is built with ghc-6.10 and that you built 0.8 with ghc-6.12. Without looking at the code, this is what happening most likely: The hledger code did not actually change. In both instances in transforms unicode characters into UTF8-encoded byte sequences (still represented as [Char]), and prints them using "putStrLn". ghc-6.10 would print these byte-for-byte, and they turn up correctly on your computer. ghc-6.12 is smarter and transforms them to the local locale, in your case, UTF8. The effect is what you see: double-encoded UTF8 strings. So this is not a bug in ghc, but a bug in hledger that turned up due to the (thankfully) more sensible behaviour in ghc. You need to talk to the hledger maintainer if he already has code that works with ghc-6.12. Greetings, Joachim -- Joachim "nomeata" Breitner Debian Developer nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata
signature.asc
Description: This is a digitally signed message part