projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
67f3b15
)
hSetEncoding: change the encoding on both read and write sides (#4066)
author
Simon Marlow
<marlowsd@gmail.com>
Fri, 14 May 2010 12:46:28 +0000
(12:46 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Fri, 14 May 2010 12:46:28 +0000
(12:46 +0000)
GHC/IO/Handle.hs
patch
|
blob
|
history
diff --git
a/GHC/IO/Handle.hs
b/GHC/IO/Handle.hs
index
1c61191
..
ff37738
100644
(file)
--- a/
GHC/IO/Handle.hs
+++ b/
GHC/IO/Handle.hs
@@
-268,7
+268,7
@@
hSetBuffering handle mode =
--
hSetEncoding :: Handle -> TextEncoding -> IO ()
hSetEncoding hdl encoding = do
--
hSetEncoding :: Handle -> TextEncoding -> IO ()
hSetEncoding hdl encoding = do
- withHandle "hSetEncoding" hdl $ \h_@Handle__{..} -> do
+ withAllHandles__ "hSetEncoding" hdl $ \h_@Handle__{..} -> do
flushCharBuffer h_
openTextEncoding (Just encoding) haType $ \ mb_encoder mb_decoder -> do
bbuf <- readIORef haByteBuffer
flushCharBuffer h_
openTextEncoding (Just encoding) haType $ \ mb_encoder mb_decoder -> do
bbuf <- readIORef haByteBuffer
@@
-276,8
+276,7
@@
hSetEncoding hdl encoding = do
return (Handle__{ haLastDecode = ref,
haDecoder = mb_decoder,
haEncoder = mb_encoder,
return (Handle__{ haLastDecode = ref,
haDecoder = mb_decoder,
haEncoder = mb_encoder,
- haCodec = Just encoding, .. },
- ())
+ haCodec = Just encoding, .. })
-- | Return the current 'TextEncoding' for the specified 'Handle', or
-- 'Nothing' if the 'Handle' is in binary mode.
-- | Return the current 'TextEncoding' for the specified 'Handle', or
-- 'Nothing' if the 'Handle' is in binary mode.