On 31/07/06, <b class="gmail_sendername">Olof Bjarnason</b> &lt;<a href="mailto:olof.bjarnason@gmail.com">olof.bjarnason@gmail.com</a>&gt; wrote:<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>1) reading UTF-8 coded text files into unicode-enabled Strings, lets call them UString
<br>2) writing UStrings to UTF-8 coded text files<br>3) using unicode strings in-code, that is in my .hs files<br></div></blockquote></div><br>In case of GHC:<br><br>String (Char actually) is unicode enabled. The current stable version cannot read UTF-8 encoded source files though (I've written a converter to workaround it - it escapes the national characters). The development version however is capable of reading UTF-8 encoded source files and does encode read strings using unicode.
<br><br>However - the IO is not aware of Unicode. So in order to do 1) and 2) you have to<br>- read/write stream of bytes encoding text in UTF-8 from/to a file<br>- convert it to/from Unicode encoding.<br><br>The first one is just about reading/writing using normal IO operations. The second can be done with the following module:
<br><br><a href="http://repetae.net/john/repos/jhc/UTF8.hs">http://repetae.net/john/repos/jhc/UTF8.hs</a><br><br>Note also that the same procedure would apply to simply printing/reading to/from the screen.<br><br>Does that help?
<br><br>Regards,<br>Piotr Kalinowski<br clear="all"><br>-- <br>Intelligence is like a river: the deeper it is, the less noise it makes