[project @ 2001-04-27 08:31:54 by simonmar]
[ghc-hetmet.git] / ghc / compiler / utils / Outputable.lhs
index 165ce03..2dd48ce 100644 (file)
@@ -371,8 +371,8 @@ showCharLit c rest
 -- of Char and String.
 
 pprHsChar :: Int -> SDoc
-pprHsChar c | not (inCharRange c) = char '\\' <> show (fromIntegral c :: Word32)
-            | otherwise = text (show (chr c))
+pprHsChar c | c > 0x10ffff = char '\\' <> show (fromIntegral c :: Word32)
+            | otherwise    = text (show (chr c))
 
 pprHsString :: FastString -> SDoc
 pprHsString fs = text (show (unpackFS fs))