No subject
Thu Feb 24 17:58:36 CET 2011
with UTF-8. No working code will be broken.
** JHC
"JHC allows unrestricted use of the Unicode character set in Haskell
source, treating input as UTF-8." [5]
** Hugs
Hugs treats input as being in the encoding specified by the current
locale, but permits Unicode only in comments and character and string
literals. [6]
* Related proposal
There is one, 5 year old, proposal that is related:
"SourceEncodingDetection" [5]. There it is proposed to detect the
encoding using an algorithm which can distinguish between UTF-8,
UTF-16 and (not always) UTF-32. It can also detect the endianness of
the document, if applicable.
I think choosing just UTF-8 is a better choice than a detection
algorithm. It places less burden on implementation writers and is even
more portable.
* Next step
Discussion! There was already some discussion on the haskell-cafe
mailing list [7].
Attached is a patch for the Haskell Report which adds a note stating
that source encodings must be UTF-8.
Regards,
Roel van Dijk
[1] - http://hackage.haskell.org/trac/haskell-prime/wiki/Process
[2] - http://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-150002.1
[3] - http://www.unicode.org/faq/utf_bom.html#bom5
[4] - http://www.haskell.org/ghc/docs/7.0-latest/html/users_guide/separate-compilation.html#source-files
[5] - http://hackage.haskell.org/trac/haskell-prime/wiki/SourceEncodingDetection
[6] - http://cvs.haskell.org/Hugs/pages/users_guide/locale.html
[7] - http://article.gmane.org/gmane.comp.lang.haskell.cafe/87815
--e0cb4e43b285dfe30b04a01f8fef
Content-Type: application/octet-stream; name="utf8_encoding.dpatch"
Content-Disposition: attachment; filename="utf8_encoding.dpatch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gm3zr1nb0
MSBwYXRjaCBmb3IgcmVwb3NpdG9yeSBodHRwOi8vZGFyY3MuaGFza2VsbC5vcmcvaGFza2VsbDIw
MTAtcmVwb3J0OgoKVHVlIEFwciAgNSAwMDo0MjozNyBDRVNUIDIwMTEgIFJvZWwgdmFuIERpamsg
PHZhbmRpamsucm9lbEBnbWFpbC5jb20+CiAgKiBBZGRlZCBub3RlIHRoYXQgc291cmNlIGZpbGVz
IG11c3QgYmUgVVRGLTgKCk5ldyBwYXRjaGVzOgoK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