[Haskell-cafe] getting crazy with character encoding

Seth Gordon sethg at ropine.com
Wed Sep 12 11:40:11 EDT 2007

Andrea Rossato wrote:
> What puzzles me is the behavior of putStrLn.

putStrLn is sending the following bytes to standard output:

97, 98, 195, 168, 195, 168, 195, 168, 10

Since the code that renders characters in your terminal emulator is 
expecting UTF-8[*], each (195, 168) pair of bytes is rendered as "è".

The Unix utility "od" can be very helpful in figuring out problems like 

[*]At least on my computer, I get the same result *even if* I change 
"LANG" from "en_US.utf8" to "C".

More information about the Haskell-Cafe mailing list