Lexical Error In String/character Literal Utf-8 Decoding Error Haskell
Lists & IRC The GHC Team Documentation GHC Status Info Building Guide Working conventions Commentary Debugging Infrastructure View Tickets My Tickets Tickets I Created By Milestone By OS By Architecture Patches for review Create Ticket New Bug New Task New Feature Req Wiki Title Index Recent lexical error in string/character literal at character '\n' Changes Wiki Notes Opened 5 years ago Closed 5 years ago #5518 closed bug (fixed) haskell lexical error at character Some unicode symbols are not allow in literal characters or strings Reported by: ertai Owned by: Priority: normal Milestone: Component: Compiler Version: 7.0.3 lexical error at character '\8217' Keywords: Cc: Operating System: Linux Architecture: x86_64 (amd64) Type of failure: None/Unknown Test Case: Blocked By: Blocking: Related Tickets: Differential Rev(s): Wiki Page: Description main = putChar 'ₖ' This program is rejected with following error message: lexical error haskell multiline string in string/character literal at character '\8342' There is at least a few other characters with the same issue, for instance this whole string should be accepted: "ₕₖₗₘₙₒₚᵣₛₜᵤᵥₓ" A related issue is that GHCi do not let me paste these characters either. Attachments (1) q.hs (23 bytes) - added by ertai 5 years ago. Download all attachments as: .zip Oldest first Newest first Threaded Comments only Change History (7) comment:1 Changed 5 years ago by judahj GHC requires that source files be encoded in UTF-8. Can you please check whether that's the case for your program? If you're not sure or if that didn't fix the problem, can you please attach the bad program to this ticket? For ghci: What terminal are you using (e.g. xterm, urxvt, etc.)? Also, please let us know the results of running these commands in that terminal: echo $TERM echo $LANG comment:2 Changed 5 years ago by igloo Status changed from new to infoneeded It works for me: $ hexdump -C q.hs 00000000 0a 6d 61 69 6e 20 3d 20 70 75 74 43 68 61 72 20 |.main = putChar | 00000010 27 e2 82 96 27 0a 0a |'...'..| 00000017 $ ghc -c q.hs $ Changed 5 years ago by ertai Attachment q.hs added comment:3 Changed 5 years ago by ertai Version changed from 7.2.1 to 7.0.3 I reproduce the same file than igloo and I have the same output for hexdump. However ghc -c q.hs yields: q.hs:2:17: lexical error in string/character literal at character '\8342' (the GHC version I use is actually 7.0.3, I updated the ticket info) echo $TERM rxvt-unicode-256color echo $LANG en_US.UTF-8 comment:4 Changed 5 years ago by judahj I could reproduce the issue with ghc-7.0.3 and ghc-7.0.4. I looked into this since it seemed to be affecting Haskeline too. The cause (
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Haskell Error lexical error in string/character literal at character ' \r' up vote 1 down vote favorite Hello I'm https://ghc.haskell.org/trac/ghc/ticket/5518 trying to write a program that converts markdown to HTML, I understand there is Pandoc but my project is writing it out manually. I have it completed or at least I think i Do but I'm getting the following error Haskell Error lexical error in string/character literal at character ' \r' I have no Idea as to what is referring to, any help in pointing it out would be great. Thanks So update: http://stackoverflow.com/questions/27329771/haskell-error-lexical-error-in-string-character-literal-at-character-r I changed a few things with misc symbols and the error I get now is hs.38:17: Not in scope 'str' and as I was working through the thing it has repeatedly kept pointing at line 38 in which I cannot figure out what the issue is as it ignores the same exact thing in the previous function module Main ( convertToHTML, convertSpecialChar, main ) where import System.Environment (getArgs) import System.IO import Data.Char import Data.List import Data.List.Split eof = "