Ticket #397 (closed feature request: fixed)

Opened 8 years ago

Last modified 5 years ago

Reading source files in encodings other than Latin-1

Reported by: nobody Owned by: nobody
Priority: normal Milestone:
Component: Compiler Version: None
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonmar) (diff)

For GHC 6.4 on SuSE Linux 9.2 (installed from the GHC RPM).  
 
When including SOME non-ascii characters in character or 
string literals, in the source code, I get a "lexical error in 
string/character literal" error message. Examples are some 
french accents and german umlauts - é,Ü,Ä. However, with 
other characters from the same set (like üä) there is no 
problem, they are processed correctly 
 
I checked with Hugs and there were no problems, so it seems 
to be a GHC bug. 
 
For further questions send email to: Rainer Volz, mail at 
vrtprj.com 
 
 
 
 
 

Change History

Changed 8 years ago by simonmar

Logged In: YES 
user_id=48280

It works fine for me.  What encoding are you using?  GHC
only understands the Latin-1 (ISO8859-1) encoding for source
files.  If you are using Latin-1, then please attach a
source file that we can test.

Changed 8 years ago by nobody

Logged In: NO 

Ah ok, I read so much about Haskell and Unicode that I didn't think 
about that. My system uses UTF-8 as standard encoding, so Emacs 
saves the source file also in that encoding. 
 
Using ISO-8859-1 as encoding to save the file helps with the lexical 
error. However the strings are still not displayed correctly. I tried it 
with texts in wxhaskell windows and with simple putStr "Üo" scripts.  
 
Do I have to change my system's encoding to IOS8859-1 to get 
proper results? 

Changed 8 years ago by simonmar

  • summary changed from lexical error with non-ascii chars in literals to Reading source files in encodings other than Latin-1
Logged In: YES 
user_id=48280

I don't know about wxHaskell, it's possible that it is using
your system's default encoding.

Thanks for the report anyway.  I'll re-brand it as a feature
request.

Changed 7 years ago by simonmar

  • status changed from assigned to closed
  • description modified (diff)
  • os set to Unknown
  • component changed from None to Compiler
  • difficulty set to Unknown
  • architecture set to Unknown
  • resolution changed from None to fixed

Fixed: GHC 6.6 will accept UTF-8 source files.

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
Note: See TracTickets for help on using tickets.