Commits

Bryan O'Sullivan committed e996bc7

Mark the ASCII decoding functions as deprecated.

Comments (0)

Files changed (3)

Data/Text/Encoding.hs

 -- 'decodeUtf8With' allows the programmer to determine what to do on a
 -- decoding error.
 
--- | Decode a 'ByteString' containing 7-bit ASCII encoded text.
+-- | /Deprecated/.  Decode a 'ByteString' containing 7-bit ASCII
+-- encoded text.
+--
+-- This function is deprecated.  Use 'decodeUtf8' instead.
 decodeASCII :: ByteString -> Text
-decodeASCII bs = F.unstream (E.streamASCII bs)
-{-# INLINE decodeASCII #-}
+decodeASCII = decodeUtf8
+{-# DEPRECATED decodeASCII "Use decodeUtf8 instead" #-}
 
 -- | Decode a 'ByteString' containing UTF-8 encoded text.
 decodeUtf8With :: OnDecodeError -> ByteString -> Text

Data/Text/Encoding/Fusion.hs

           | otherwise = Yield (unsafeChr8 x1) (i+1)
           where
             x1 = B.unsafeIndex bs i
+{-# DEPRECATED streamASCII "Do not use this function" #-}
 {-# INLINE [0] streamASCII #-}
 
 -- | /O(n)/ Convert a 'ByteString' into a 'Stream Char', using UTF-8

Data/Text/Lazy/Encoding.hs

 -- 'decodeUtf8With' allows the programmer to determine what to do on a
 -- decoding error.
 
--- | Decode a 'ByteString' containing 7-bit ASCII encoded text.
+-- | /Deprecated/.  Decode a 'ByteString' containing 7-bit ASCII
+-- encoded text.
+--
+-- This function is deprecated.  Use 'decodeUtf8' instead.
 decodeASCII :: B.ByteString -> Text
-decodeASCII bs = foldr (chunk . TE.decodeASCII) empty (B.toChunks bs)
-{-# INLINE decodeASCII #-}
+decodeASCII = decodeUtf8
+{-# DEPRECATED decodeASCII "Use decodeUtf8 instead" #-}
 
 -- | Decode a 'ByteString' containing UTF-8 encoded text.
 decodeUtf8With :: OnDecodeError -> B.ByteString -> Text