UTF-8 decoding error

Simon Marlow simonmarhaskell at gmail.com
Fri Feb 3 06:37:56 EST 2006


Christian Maeder wrote:

> with ghc-6.5.20060201 I get a "UTF-8 decoding error" for latin1 
> characters in my string literals.
> 
> Do I have to change my sources or can I set a certain environment variable?
> 
> I have LANG=de_DE at euro and LC_CTYPE not set (which is ok for hugs)

GHC is now expected source files to be UTF-8 only.  I really did this as 
an experiment to see if anyone complained, because it will be more work 
to implement other encodings.  You're the second person to notice this. 
  So - do you need Latin-1, or could you use UTF-8?

If you're using emacs, it's pretty easy to default to UTF-8 for haskell 
source files, BTW.  Just add this to your .emacs:

(modify-coding-system-alist 'file "\\.l?hs\\'" 'utf-8)

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list