Ticket #690 (closed task: wontfix)

Opened 7 years ago

Last modified 4 years ago

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: Difficulty: Moderate (less than a day)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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

Changed 7 years ago by igloo

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

-F -pgmF convert.sh

to GHC, where convert.sh contains

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

Changed 7 years ago by simonmar

  • milestone changed from 6.6 to 6.6.1

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.

Changed 7 years ago by igloo

See also 782.

Changed 7 years ago by simonmar

  • milestone changed from 6.6.1 to 6.8

Changed 6 years ago by simonmar

  • status changed from new to closed
  • resolution set to wontfix

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.

Changed 5 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.2

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

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