on master help sign in
Update doc/comment/error
commit9a253dffd8b4a320dd200ef8e3fdfcd18483aee7 authorHarendra Kumar <harendra@composewell.com> dateWed 23 Jun 2021, 15:14 (5 years ago) parent1bfdbc9
1 file changed+8−4
src/Streamly/Internal/Unicode/Stream.hs+8−4
src/Streamly/Internal/Unicode/Stream.hs+8−4
@@ -145,13 +145,17 @@ encodeLatin1' = S.map convert
145145 convert c =
146146 let codepoint = ord c
147147 in if codepoint > 255
148− then error $ "Streamly.String.encodeLatin1 invalid " ++
148+ then error $ "Streamly.Unicode.encodeLatin1 invalid " ++
149149 "input char codepoint " ++ show codepoint
150150 else fromIntegral codepoint
151151
152−-- | Like 'encodeLatin1'' but silently truncates and maps input characters beyond
153−-- 255 to (incorrect) chars in 0-255 range. No error or exception is thrown
154−-- when such truncation occurs.
152+-- XXX Should we instead replace the invalid chars by NUL or whitespace or some
153+-- other control char? That may affect the perf a bit but may be a better
154+-- behavior.
155+--
156+-- | Like 'encodeLatin1'' but silently maps input codepoints beyond 255 to
157+-- arbitrary Latin1 chars in 0-255 range. No error or exception is thrown when
158+-- such mapping occurs.
155159--
156160-- /Since: 0.7.0 ("Streamly.Data.Unicode.Stream")/
157161--