H98 Text IO

Ben Franksen ben.franksen at online.de
Thu Feb 28 17:53:50 EST 2008

David Leuschner wrote:
> If I write simple program just printing a non-ASCII string to the terminal
> or to a file I'd expect that I can read it on the screen or using my
> favorite text editor without having change anything -- neither in my
> terminal nor in my program.  When I run the program on my platform don't
> mind if somebody else might get differently encoded output from the same
> program as long as I get what I expect. 

I think this is sensible advice. Furthermore I want to be able to chose an
encoding (e.g. by setting my environment), even for file/socket IO, instead
of being locked into utf-8. Thus, for Linux, I'd say always use the
environment encoding.

More advanced stuff like sending in a certain encoding e.g. over network or
to a foreign file system should not use H98 IO but newer libraries that
allow to set the encoding programmatically, or encode yourself and
read/write Word8.


More information about the Glasgow-haskell-users mailing list