[remove custom utf8 code in favor of using utf8-string library
John Meacham <john@repetae.net>**20090220205217
 Ignore-this: 5ae497a5bd70679d8ce1444a11a785b6
] hunk ./CharIO.hs 10
-    CharIO.readFile,
-    CharIO.print,
-    CharIO.hGetContents,
+    readFile,
+    print,
+    hGetContents,
hunk ./CharIO.hs 16
-import Char
hunk ./CharIO.hs 17
-import Prelude hiding(putStr, putStrLn)
+import Prelude hiding(readFile, print, putStr, putStrLn)
hunk ./CharIO.hs 20
-import UTF8
hunk ./CharIO.hs 21
-import qualified Prelude (putStr, putStrLn)
+import System.IO.UTF8 as U
hunk ./CharIO.hs 23
-toUTF8 s = (map (chr. fromIntegral) $ toUTF s)
-fromUTF8 s = fromUTF (map (fromIntegral . ord) s)
hunk ./CharIO.hs 27
-putStr = Prelude.putStr . toUTF8
-putStrLn = Prelude.putStrLn . toUTF8
-putErr s = flushOut >> IO.hPutStr IO.stderr (toUTF8 s)
-putErrLn s = flushOut >> hPutStrLn IO.stderr s
-putErrDie s = flushOut >> hPutStrLn IO.stderr s >> System.exitFailure
-print x = putStrLn $ show x
+putErr s = flushOut >> U.hPutStr IO.stderr s
+putErrLn s = flushOut >> U.hPutStrLn IO.stderr s
+putErrDie s = flushOut >> U.hPutStrLn IO.stderr s >> System.exitFailure
hunk ./CharIO.hs 32
-hPutStrLn fh = IO.hPutStrLn fh . toUTF8
-
-readFile fn = Prelude.readFile fn >>= \s -> return (fromUTF8 s)
-hGetContents h =  IO.hGetContents h >>= \s -> return (fromUTF8 s)
hunk ./Ho/Build.hs 69
-import qualified UTF8
+import qualified Data.ByteString.Lazy.UTF8 as LBS
hunk ./Ho/Build.hs 546
-    let txt = UTF8.fromUTF $ LBS.unpack lbs
+    let txt = LBS.toString lbs
hunk ./Main.hs 99
-catom action = action `finally` dumpToFile
hunk ./Main.hs 100
-main = do -- runMain $ catom $ bracketHtml $ do
+main =  runMain $ bracketHtml $ do
hunk ./Makefile.am 36
-	Support/Tuple.hs Support/Unparse.hs UTF8.hs Util/BitSet.hs Util/ContextMonad.hs Util/FilterInput.hs \
+	Support/Tuple.hs Support/Unparse.hs Util/BitSet.hs Util/ContextMonad.hs Util/FilterInput.hs \
hunk ./Makefile.am 47
-PACKAGES= -package mtl  -package unix -package QuickCheck -ignore-package lang
+PACKAGES= -package mtl  -package unix  -ignore-package lang -package utf8-string -package binary -package zlib
hunk ./StringTable/Atom.hsc 20
+import qualified Data.ByteString.UTF8 as BS(fromString,toString)
hunk ./StringTable/Atom.hsc 34
-import PackedString(PackedString(..))
hunk ./StringTable/Atom.hsc 71
-instance ToAtom PackedString where
-    toAtomIO (PS x) = toAtomIO x
-instance FromAtom PackedString where
-    fromAtomIO atom = PS `liftM` fromAtomIO atom
-
-
hunk ./StringTable/Atom.hsc 95
-    toAtomIO s = toAtomIO (BS.pack (toUTF s))
+    toAtomIO s = toAtomIO (BS.fromString s)
hunk ./StringTable/Atom.hsc 98
-    fromAtom = fromUTF . BS.unpack . fromAtom
+    fromAtom = BS.toString . fromAtom
hunk ./StringTable/Atom.hsc 153
--- | Convert Unicode characters to UTF-8.
-toUTF :: String -> [Word8]
-toUTF [] = []
-toUTF (x:xs) | ord x<=0x007F = (fromIntegral $ ord x):toUTF xs
-	     | ord x<=0x07FF = fromIntegral (0xC0 .|. ((ord x `shift` (-6)) .&. 0x1F)):
-			       fromIntegral (0x80 .|. (ord x .&. 0x3F)):
-			       toUTF xs
-	     | otherwise     = fromIntegral (0xE0 .|. ((ord x `shift` (-12)) .&. 0x0F)):
-			       fromIntegral (0x80 .|. ((ord x `shift` (-6)) .&. 0x3F)):
-			       fromIntegral (0x80 .|. (ord x .&. 0x3F)):
-			       toUTF xs
-
--- | Convert UTF-8 to Unicode.
-
-fromUTF :: [Word8] -> String
-fromUTF xs = fromUTF' (map fromIntegral xs) where
-    fromUTF' [] = []
-    fromUTF' (all@(x:xs))
-	| x<=0x7F = (chr (x)):fromUTF' xs
-	| x<=0xBF = err
-	| x<=0xDF = twoBytes all
-	| x<=0xEF = threeBytes all
-	| otherwise   = err
-    twoBytes (x1:x2:xs) = chr  ((((x1 .&. 0x1F) `shift` 6) .|.
-			       (x2 .&. 0x3F))):fromUTF' xs
-    twoBytes _ = error "fromUTF: illegal two byte sequence"
-
-    threeBytes (x1:x2:x3:xs) = chr ((((x1 .&. 0x0F) `shift` 12) .|.
-				    ((x2 .&. 0x3F) `shift` 6) .|.
-				    (x3 .&. 0x3F))):fromUTF' xs
-    threeBytes _ = error "fromUTF: illegal three byte sequence"
-
-    err = error "fromUTF: illegal UTF-8 character"
hunk ./UTF8.hs 1
---  $Id: UTF8.hs,v 1.4 2004/02/28 04:20:46 john Exp $
--- arch-tag: 596040c5-d420-4cc6-add6-c4612cfe2d27
-
-module UTF8(toUTF, fromUTF) where
-
-import Bits
-import Char
-import Word(Word8)
-
-
-
--- | Convert Unicode characters to UTF-8.
-toUTF :: String -> [Word8]
-toUTF [] = []
-toUTF (x:xs) | ord x<=0x007F = (fromIntegral $ ord x):toUTF xs
-	     | ord x<=0x07FF = fromIntegral (0xC0 .|. ((ord x `shift` (-6)) .&. 0x1F)):
-			       fromIntegral (0x80 .|. (ord x .&. 0x3F)):
-			       toUTF xs
-	     | otherwise     = fromIntegral (0xE0 .|. ((ord x `shift` (-12)) .&. 0x0F)):
-			       fromIntegral (0x80 .|. ((ord x `shift` (-6)) .&. 0x3F)):
-			       fromIntegral (0x80 .|. (ord x .&. 0x3F)):
-			       toUTF xs
-
--- | Convert UTF-8 to Unicode.
-
-fromUTF :: [Word8] -> String
-fromUTF xs = fromUTF' (map fromIntegral xs) where
-    fromUTF' [] = []
-    fromUTF' (all@(x:xs))
-	| x<=0x7F = (chr (x)):fromUTF' xs
-	| x<=0xBF = err
-	| x<=0xDF = twoBytes all
-	| x<=0xEF = threeBytes all
-	| otherwise   = err
-    twoBytes (x1:x2:xs) = chr  ((((x1 .&. 0x1F) `shift` 6) .|.
-			       (x2 .&. 0x3F))):fromUTF' xs
-    twoBytes _ = error "fromUTF: illegal two byte sequence"
-
-    threeBytes (x1:x2:x3:xs) = chr ((((x1 .&. 0x0F) `shift` 12) .|.
-				    ((x2 .&. 0x3F) `shift` 6) .|.
-				    (x3 .&. 0x3F))):fromUTF' xs
-    threeBytes _ = error "fromUTF: illegal three byte sequence"
-
-    err = error "fromUTF: illegal UTF-8 character"
rmfile ./UTF8.hs
hunk ./docs/development.mkd 23
+    * utf8-string ghc library