summaryrefslogtreecommitdiffstats
path: root/Codec
diff options
context:
space:
mode:
authorSigbjorn Finne <sof@galois.com>2008-09-19 09:55:01 -0700
committerSigbjorn Finne <sof@galois.com>2008-09-19 09:55:01 -0700
commit3bc46d19146c73a7984bacb2b8685989b6a4b2da (patch)
tree8fdaae862b0493121bd2deace35d0ac01cd85775 /Codec
parent7567f36fdfc9f6416bba4db23e4f9bbdcf874dff (diff)
fix terrible QP encoding snafu + tidyups
Diffstat (limited to 'Codec')
-rw-r--r--Codec/MIME/Base64.hs4
-rw-r--r--Codec/MIME/Decode.hs6
-rw-r--r--Codec/MIME/Parse.hs6
-rw-r--r--Codec/MIME/QuotedPrintable.hs6
-rw-r--r--Codec/MIME/Type.hs5
-rw-r--r--Codec/MIME/Utils.hs5
6 files changed, 17 insertions, 15 deletions
diff --git a/Codec/MIME/Base64.hs b/Codec/MIME/Base64.hs
index a8da683..ffca6c1 100644
--- a/Codec/MIME/Base64.hs
+++ b/Codec/MIME/Base64.hs
@@ -1,9 +1,9 @@
{- |
Module : Codec.MIME.Parse
- Copyright : (c) 2006-2007
+ Copyright : (c) 2006-2008
- Maintainer :
+ Maintainer : Sigbjorn Finne <sof@galois.com>
Stability : unstable
Portability : GHC
diff --git a/Codec/MIME/Decode.hs b/Codec/MIME/Decode.hs
index 3fbbddf..f82daf2 100644
--- a/Codec/MIME/Decode.hs
+++ b/Codec/MIME/Decode.hs
@@ -1,10 +1,10 @@
--------------------------------------------------------------------
-- |
-- Module : Codec.MIME.Decode
--- Copyright : (c) Galois, Inc. 2006..2008
+-- Copyright : (c) 2006-2008, Galois, Inc.
-- License : BSD3
--
--- Maintainer: Don Stewart <dons@galois.com>
+-- Maintainer: Sigbjorn Finne <sof@galois.com>
-- Stability : provisional
-- Portability:
--
@@ -24,7 +24,7 @@ decodeBody enc body =
"quoted-printable" -> QP.decode body
_ -> body
--- Decoding of RFC 2047's "encoded-words' production
+-- Decoding of RFC 2047's "encoded-words" production
-- (as used in email-headers and some HTTP header cases
-- (AtomPub's Slug: header))
decodeWord :: String -> Maybe (String, String)
diff --git a/Codec/MIME/Parse.hs b/Codec/MIME/Parse.hs
index e37578e..629a0cf 100644
--- a/Codec/MIME/Parse.hs
+++ b/Codec/MIME/Parse.hs
@@ -1,8 +1,8 @@
{- |
- Module : MIME.Parse
- Copyright : (c) 2006-2007 Galois Inc.
+ Module : Codec.MIME.Parse
+ Copyright : (c) 2006-2008 Galois Inc.
- Maintainer : tse-dev-team@galois.com
+ Maintainer : Sigbjorn Finne <sof@galois.com>
Stability : unstable
Portability : GHC
diff --git a/Codec/MIME/QuotedPrintable.hs b/Codec/MIME/QuotedPrintable.hs
index a6dc99a..ec57ba5 100644
--- a/Codec/MIME/QuotedPrintable.hs
+++ b/Codec/MIME/QuotedPrintable.hs
@@ -4,7 +4,7 @@
-- Copyright : (c) Galois, Inc. 2008
-- License : BSD3
--
--- Maintainer:
+-- Maintainer: Sigbjorn Finne <sof@galois.com>
-- Stability : provisional
-- Portability:
--
@@ -42,14 +42,14 @@ encodeLength :: Int -> String -> String
encodeLength _ "" = ""
encodeLength n (x:xs)
| n >= 72 = '=':'\r':'\n':encodeLength 0 (x:xs)
-encodeLength n ('=':xs)
+encodeLength _ ('=':xs)
= '=':'3':'D':encodeLength 0 xs
encodeLength n (x:xs)
| ox >= 0x100 = error ("QuotedPrintable.encode: encountered > 8 bit character: " ++ show (x,ox))
| n >= 72 = '=':'\r':'\n':encodeLength 0 (x:xs)
| ox >= 0x21 && ox <= 0x7e = x : encodeLength (n+1) xs
| ox == 0x09 || ox == 0x20 = x : encodeLength (n+1) xs
- | otherwise = '=':'\r':'\n':encodeLength 0 (x:xs)
+ | otherwise = '=':showH (ox `div` 0x10): showH (ox `mod` 0x10):encodeLength (n+3) xs
where
ox = ord x
showH v
diff --git a/Codec/MIME/Type.hs b/Codec/MIME/Type.hs
index 7f40554..8d9830a 100644
--- a/Codec/MIME/Type.hs
+++ b/Codec/MIME/Type.hs
@@ -1,9 +1,10 @@
{- |
Module : MIME.Type
- Copyright : (c) 2006-2007 Galois Inc.
+ Copyright : (c) 2006-2008, Galois Inc.
+- License : BSD3
- Maintainer : tse-dev-team@galois.com
+ Maintainer : Sigbjorn Finne <sof@galois.com>
Stability : unstable
Portability : GHC
diff --git a/Codec/MIME/Utils.hs b/Codec/MIME/Utils.hs
index f0bb2a1..143b770 100644
--- a/Codec/MIME/Utils.hs
+++ b/Codec/MIME/Utils.hs
@@ -1,8 +1,9 @@
{- |
Module : MIME.Utils
- Copyright : (c) 2007
+ Copyright : (c) 2007-2008, Galois, Inc.
+ License : BSD3
- Maintainer : tse-dev-team@galois.com
+ Maintainer : Sigbjorn Finne <sof@galois.com>
Stability : unstable
Portability : GHC