on master help sign in
Remove old UTF-8 encoding functions

--HG-- extra : convert_revision : c10b0a8c51e03f7f3f0d7913eddf1052952a0e8b

commit813656272d696f48ec262627cf985fecd12fa436 authorBryan O'Sullivan <bos@serpentine.com> dateThu 14 Oct 2010, 19:57 (16 years ago) parentda1bc90
3 files changed−22
Data/Text/Encoding.hs−6 Data/Text/Lazy/Encoding.hs−6 tests/benchmarks/EncodeUtf8.hs−10
Data/Text/Encoding.hs−6
@@ -35,7 +35,6 @@ module Data.Text.Encoding
3535
3636 -- * Encoding Text to ByteStrings
3737 , encodeUtf8
38− , encodeUtf8'
3938 , encodeUtf16LE
4039 , encodeUtf16BE
4140 , encodeUtf32LE
@@ -74,11 +73,6 @@ decodeUtf8 :: ByteString -> Text
7473decodeUtf8 = decodeUtf8With strictDecode
7574{-# INLINE decodeUtf8 #-}
7675
77−-- | Encode text using UTF-8 encoding.
78−encodeUtf8' :: Text -> ByteString
79−encodeUtf8' txt = E.unstream (E.restreamUtf8 (F.stream txt))
80−{-# INLINE encodeUtf8' #-}
81−
8276-- | Encode text using UTF-8 encoding.
8377encodeUtf8 :: Text -> ByteString
8478encodeUtf8 (Text arr off len) = unsafePerformIO $ do
Data/Text/Lazy/Encoding.hs−6
@@ -32,7 +32,6 @@ module Data.Text.Lazy.Encoding
3232
3333 -- * Encoding Text to ByteStrings
3434 , encodeUtf8
35− , encodeUtf8'
3635 , encodeUtf16LE
3736 , encodeUtf16BE
3837 , encodeUtf32LE
@@ -62,11 +61,6 @@ decodeUtf8 :: B.ByteString -> Text
6261decodeUtf8 = decodeUtf8With strictDecode
6362{-# INLINE decodeUtf8 #-}
6463
65−-- | Encode text using UTF-8 encoding.
66−encodeUtf8' :: Text -> B.ByteString
67−encodeUtf8' txt = E.unstream (E.restreamUtf8 (F.stream txt))
68−{-# INLINE encodeUtf8' #-}
69−
7064encodeUtf8 :: Text -> B.ByteString
7165encodeUtf8 (Chunk c cs) = B.Chunk (TE.encodeUtf8 c) (encodeUtf8 cs)
7266encodeUtf8 Empty = B.Empty
tests/benchmarks/EncodeUtf8.hs−10
@@ -19,14 +19,6 @@ lazy_bytestring k s = do
1919 let t = TL.replicate (fromIntegral k) (TL.pack s)
2020 BL.putStr (TL.encodeUtf8 t)
2121
22−strict_bytestring_ k s = do
23− let t = T.replicate k (T.pack s)
24− B.putStr (T.encodeUtf8' t)
25−
26−lazy_bytestring_ k s = do
27− let t = TL.replicate (fromIntegral k) (TL.pack s)
28− BL.putStr (TL.encodeUtf8' t)
29−
3022strict_io k s = do
3123 let t = T.replicate k (T.pack s)
3224 hSetEncoding stdout utf8
@@ -56,8 +48,6 @@ main = do
5648 case kind of
5749 "strict" -> strict_bytestring k str
5850 "lazy" -> lazy_bytestring k str
59− "strict_" -> strict_bytestring_ k str
60− "lazy_" -> lazy_bytestring_ k str
6151 "strict_io" -> strict_io k str
6252 "lazy_io" -> lazy_io k str
6353 "string" -> string k str