Ticket #1079 (closed feature request: wontfix)
refinement for GHC's support of UTF-8 encoding
|Reported by:||mukai@…||Owned by:|
|Keywords:||Cc:||Bulat.Ziganshin@…, id@…, shelarcy@…|
|Type of failure:||Difficulty:||Unknown|
|Test Case:||Blocked By:|
Description (last modified by Isaac Dupree) (diff)
From 6.6, GHC supports UTF-8 encoding in the source programs. GHC can read UTF-8 files and convert them into Unicode characters. However, there are no support to read/print them.
For example, we can compile the following program,
main = putStrLn "あ"
but we only get B, the least 8bit of the character あ (U+3042). Because of this incompleteness, we cannot print any non-ascii characters without converting for the case of writing Haskell codes with UTF-8. Although it is easy to write converting functions for this purpose, such converting should be supported by the compiler.
IMHO, desired approach is similar to Hugs. In Hugs, when printing non-ascii characters, it first converts the characters to UTF-8 octets and then prints them. However, with binary-mode Handle, it just print characters without convert. This behavior will be acceptable for many haskell programmers.