
I am getting the following error when trying to do a show on a Ranges object :- C:\Languages\Haskell>ghci rangeTest.hs GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. [1 of 1] Compiling Main ( rangeTest.hs, interpreted ) Ok, modules loaded: Main. *Main> main Loading package array-0.3.0.1 ... linking ... done. Loading package containers-0.3.0.0 ... linking ... done. Loading package ranges-0.2.3 ... linking ... done. Ranges [(37*** Exception: <stdout>: hPutChar: invalid argument (character is not in the code page) *Main> I have attached the test source also :- import Data.Ranges test = (ranges [ range 32 33, range 34 35, range 37 39 ]) main :: IO () main = do { putStrLn (show test) } I am probably doing something fundermentaly wrong. Many thanks in advance, Aaron

On 22 January 2011 02:32, Aaron Gray
I am getting the following error when trying to do a show on a Ranges object :-
C:\Languages\Haskell>ghci rangeTest.hs GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. [1 of 1] Compiling Main ( rangeTest.hs, interpreted ) Ok, modules loaded: Main. *Main> main Loading package array-0.3.0.1 ... linking ... done. Loading package containers-0.3.0.0 ... linking ... done. Loading package ranges-0.2.3 ... linking ... done. Ranges [(37*** Exception: <stdout>: hPutChar: invalid argument (character is not in the code page) *Main>
I have attached the test source also :-
import Data.Ranges
test = (ranges [ range 32 33, range 34 35, range 37 39 ])
main :: IO () main = do { putStrLn (show test) }
Data.Ranges.hs:12 show (Range x y) = concat ["(", show x, "–", show y, ")"] Contains the following charcter sequence :- – Which does not seem to be supported in Windows codepage. Aaron

On Saturday 22 January 2011 03:47:55, Aaron Gray wrote:
Data.Ranges.hs:12
show (Range x y) = concat ["(", show x, "–", show y, ")"]
Contains the following charcter sequence :-
–
Which does not seem to be supported in Windows codepage.
Aaron
For me, that's an en-dash (U+2013 / '\8211'). I believe something on your box mangled the UTF-8 encoding.

On 22 January 2011 13:15, Daniel Fischer
On Saturday 22 January 2011 03:47:55, Aaron Gray wrote:
Data.Ranges.hs:12
show (Range x y) = concat ["(", show x, "–", show y, ")"]
Contains the following charcter sequence :-
–
Which does not seem to be supported in Windows codepage.
Aaron
For me, that's an en-dash (U+2013 / '\8211'). I believe something on your box mangled the UTF-8 encoding.
Weird I did a cabal install and have not touched it with an editor. Are you on Windows ? Aaron

On Saturday 22 January 2011 17:01:00, Aaron Gray wrote:
For me, that's an en-dash (U+2013 / '\8211'). I believe something on your box mangled the UTF-8 encoding.
Weird I did a cabal install and have not touched it with an editor.
Except to look at it trying to find the issue, I suppose (how else did you find the "–")? What's your locale? Could also be that GHC tries to interpret UTF-8 in your locale and barfs on that.
Are you on Windows ?
No, linux.
Aaron

On 22 January 2011 16:31, Daniel Fischer
On Saturday 22 January 2011 17:01:00, Aaron Gray wrote:
For me, that's an en-dash (U+2013 / '\8211'). I believe something on your box mangled the UTF-8 encoding.
Weird I did a cabal install and have not touched it with an editor.
Except to look at it trying to find the issue, I suppose (how else did you find the "–")?
I downloaded it separately from the HackageDB.
What's your locale? Could also be that GHC tries to interpret UTF-8 in your locale and barfs on that.
Not sure ? Vista's default.
Are you on Windows ?
No, linux.
Ah How do I get Cabal to install a package from disk rather than from the internet ? Many thanks, Aaron

On Saturday 22 January 2011 17:42:39, Aaron Gray wrote:
What's your locale? Could also be that GHC tries to interpret UTF-8 in your locale and barfs on that.
Not sure ? Vista's default.
Which probably isn't UTF-8. There must be an analogue of locale on Windows to check.
Are you on Windows ?
No, linux.
Ah
How do I get Cabal to install a package from disk rather than from the internet ?
If it's unpacked, just cd into the package directory and do a $ cabal install there (optionally provide further command line args, but not the package name) or $ runghc ./Setup.hs configure --user $ runghc ./Setup.hs build $ runghc ./Setup.hs install If it's a .tar.gz, I don't know if cabal already supports installing those from a specified location (i.e., not from hackage or its cache).
Many thanks,
Aaron
Cheers, Daniel

On 22 January 2011 17:04, Daniel Fischer
On Saturday 22 January 2011 17:42:39, Aaron Gray wrote:
What's your locale? Could also be that GHC tries to interpret UTF-8 in your locale and barfs on that.
Not sure ? Vista's default.
Which probably isn't UTF-8. There must be an analogue of locale on Windows to check.
Not sure I thought it was UTF-8. Its behaving differently on different Vista machines.
Are you on Windows ?
No, linux.
Ah
How do I get Cabal to install a package from disk rather than from the internet ?
If it's unpacked, just cd into the package directory and do a
$ cabal install
there (optionally provide further command line args, but not the package name)
or
$ runghc ./Setup.hs configure --user $ runghc ./Setup.hs build $ runghc ./Setup.hs install
If it's a .tar.gz, I don't know if cabal already supports installing those from a specified location (i.e., not from hackage or its cache).
Thanks, Aaron

For me, that's an en-dash (U+2013 / '\8211'). I believe something on your box mangled the UTF-8 encoding.
When I saw this last night, I looked out of curiosity and saw the same thing, as my browser rendered the source with a dash. My thought was that this morning, someone would be embarrassed to see that he or she had gratuitously, but accidentally, made use of an exotic character when an ordinary 7 bit ASCII equivalent would have been fine and foolproof. I.e., it's a coding error, which we found out about thanks to Mr. Gray's platform encoding problem. Wrong again? Donn

Let's notify the maintainer to use an ordinary minus sign: http://hackage.haskell.org/package/ranges-0.2.3 my "scan" program (http://hackage.haskell.org/package/scan) reports: Ranges.hs:12:9: undesirable character '\t' Ranges.hs:12:51: undesirable character '\226' Ranges.hs:12:52: undesirable character '\128' Ranges.hs:12:53: undesirable character '\147' Cheers Christian Am 22.01.2011 18:33, schrieb Donn Cave:
For me, that's an en-dash (U+2013 / '\8211'). I believe something on your box mangled the UTF-8 encoding.
When I saw this last night, I looked out of curiosity and saw the same thing, as my browser rendered the source with a dash.
My thought was that this morning, someone would be embarrassed to see that he or she had gratuitously, but accidentally, made use of an exotic character when an ordinary 7 bit ASCII equivalent would have been fine and foolproof. I.e., it's a coding error, which we found out about thanks to Mr. Gray's platform encoding problem. Wrong again?
Donn
participants (5)
-
Aaron Gray
-
Christian Maeder
-
Daniel Fischer
-
Donn Cave
-
Yitzchak Gale