summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-07 18:07:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-07 18:07:13 -0400
commitb116facc4a99ee63c82fa2ecec0de634c908c236 (patch)
treea9e6642e6c4077880cb894270f858f0e376fdbc2 /Assistant
parent6585821a3528b29a0e75b461d429eba54dae12b5 (diff)
remaining dataenc to sandi conversions
I've tested all the dataenc to sandi conversions except Assistant.XMPP, and all have unchanged behavior, including behavior on large unicode code points.
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/XMPP.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Assistant/XMPP.hs b/Assistant/XMPP.hs
index b9ae50e27..52cd31939 100644
--- a/Assistant/XMPP.hs
+++ b/Assistant/XMPP.hs
@@ -22,7 +22,8 @@ import qualified Data.Map as M
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
import Data.XML.Types
-import qualified "dataenc" Codec.Binary.Base64 as B64
+import qualified "sandi" Codec.Binary.Base64 as B64
+import Data.Bits.Utils
{- Name of the git-annex tag, in our own XML namespace.
- (Not using a namespace URL to avoid unnecessary bloat.) -}
@@ -212,10 +213,10 @@ encodeExitCode (ExitFailure n) = n
{- Base 64 encoding a ByteString to use as the content of a tag. -}
encodeTagContent :: ByteString -> [Node]
-encodeTagContent b = [NodeContent $ ContentText $ T.pack $ B64.encode $ B.unpack b]
+encodeTagContent b = [NodeContent $ ContentText $ T.pack $ w82s $ B.unpack $ B64.encode b]
decodeTagContent :: Element -> Maybe ByteString
-decodeTagContent elt = B.pack <$> B64.decode s
+decodeTagContent elt = either (const Nothing) Just (B64.decode $ B.pack $ s2w8 s)
where
s = T.unpack $ T.concat $ elementText elt