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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.