Opened 13 years ago

Closed 11 years ago

Last modified 9 years ago

#690 closed task (wontfix)

Accept source files in encodings other than UTF-8

Reported by: simonmar Owned by:
Priority: normal Milestone: 6.8.2
Component: Compiler Version: 6.5
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


We need to support at least Latin-1, for backwards compatibility.

One possibility is to run iconv as a preprocessor. Alternatively, call iconv directly from the compiler. What about Windows? Should there be a pragma specifying encoding, or take it from the locale, or a command-line flag, or all three?

Change History (9)

comment:1 Changed 12 years ago by igloo

Duncan Coutts points out that, as a workaround, you can pass

-F -pgmF

to GHC, where contains

( echo "{-# LINE 1 \"$2\" #-}" ; iconv -f l1 -t utf-8 $2 ) > $3

comment:2 Changed 12 years ago by simonmar


We documented the workaround using iconv for 6.6, this is unfortunately not a solution for Windows users. Punting a better solution to 6.6.1, or possibly 6.8.

comment:3 Changed 12 years ago by igloo

See also 782.

comment:4 Changed 12 years ago by simonmar


comment:5 Changed 11 years ago by simonmar

Resolution: wontfix
Status: newclosed

We don't plan to do anything here. Having source files in UTF-8 only means that source files are always shareable, which is a good thing.

comment:6 Changed 11 years ago by igloo

Milestone: 6.8 branch6.8.2

comment:7 Changed 10 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:8 Changed 10 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:9 Changed 9 years ago by simonmar

difficulty: Moderate (1 day)Moderate (less than a day)
Note: See TracTickets for help on using tickets.