How to print UTF-8 string from Haskell program for CGI? How to print UTF-8 string from Haskell program for CGI? apache apache

How to print UTF-8 string from Haskell program for CGI?


To make sure putStr uses the right encoding you can call hSetEncoding on stdout to set it to "utf8".

http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.3.1.0/System-IO.html#g:23