On Fri, Sep 16, 2005 at 11:40:19PM +0000, Mark Stosberg wrote:
> On 2005-09-09, Tommy Pettersson <[EMAIL PROTECTED]> wrote:
> > On Fri, Sep 09, 2005 at 03:17:47AM +0000, Mark Stosberg wrote:
> >> I tried this and got the same result:
> >>  DARCS_DONT_ESCAPE_ISPRINT=0 DARCS_DONT_ESCAPE_8BIT=0
> >>  DARCS_DONT_ESCAPE_EXTRA=0
> >>  DARCS_DONT_ESCAPE_TRAILING_SPACNT_ESCAPE_ANYTHING=0 prove printer.pl    
> >
> > O, I'm sorry, I forgot to mention the most important one:
> > LC_ALL=C (could you please try with that too?)
> 
> Still the same result.

Then I think it is a Haskell problem, or me who doesn't
understand how locales work in Haskell.  When I compile and
run the attached test program with ghc 6.2.2 I get:

  $ ./a.out 
  LANG   = sv_SE
  LC_ALL = Nothing
  À is printable
   is not printable
  $ LC_ALL=C ./a.out 
  LANG   = sv_SE
  LC_ALL = C
  À is not printable
   is not printable


which is the desired result.  I guess you would get "À is
printable" even with LC_LANG=C.  In that case the GHC library
has probably changed its meaning about what isPrint means in
a way that doesn't agree with libc.  (Or you are using UTF-8
and a GHC that has begun to understand UTF-8.)



-- 
Tommy Pettersson <[EMAIL PROTECTED]>
module Main
where

import Char ( isPrint )
import System.Environment ( getEnv )

main =
    do lang   <- getEnv "LANG"   `catch` \_ -> return "Nothing"
       lc_all <- getEnv "LC_ALL" `catch` \_ -> return "Nothing"
       putStrLn $ "LANG   = " ++ lang
       putStrLn $ "LC_ALL = " ++ lc_all
       testChar test_char1
       testChar test_char2
 where
    test_char1 = '\xC0'
    test_char2 = '\x90'
    testChar c = do putStr (c:" ")
                    putStrLn $ if (isPrint c) then "is printable"
                                              else "is not printable"
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to