diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,8 @@
+## 1.4.0.2
+
+* Parse XML encoding case-insensitively
+* Remove extra EOL when printing XmlException
+
 ## 1.4.0.1
 
 * Handle CDATA in takeAllTreesContent [#88](https://github.com/snoyberg/xml/pull/88)
diff --git a/Text/XML/Stream/Parse.hs b/Text/XML/Stream/Parse.hs
--- a/Text/XML/Stream/Parse.hs
+++ b/Text/XML/Stream/Parse.hs
@@ -151,6 +151,7 @@
                                                takeWhile1, try)
 import qualified Data.Attoparsec.Text         as AT
 import           Data.Conduit.Attoparsec      (PositionRange, conduitParser)
+import           Data.List                    (intercalate)
 import           Data.XML.Types               (Content (..), Event (..),
                                                ExternalID (..),
                                                Instruction (..), Name (..))
@@ -312,7 +313,7 @@
 
         findEncoding [] = fallback
         findEncoding ((TName _ "encoding", [ContentText enc]):_) =
-            case enc of
+            case TS.toLower enc of
                 "iso-8859-1" -> complete CT.iso8859_1
                 "utf-8"      -> complete CT.utf8
                 _            -> complete CT.utf8
@@ -880,7 +881,7 @@
   displayException (InvalidEntity msg (Just event)) = "Error while parsing XML entity " ++ show event ++ ": " ++ msg
   displayException (InvalidEntity msg _) = "Error while parsing XML entity: " ++ msg
   displayException (MissingAttribute msg) = "Missing required attribute: " ++ msg
-  displayException (UnparsedAttributes attrs) = show (length attrs) ++ " remaining unparsed attributes: \n" ++ unlines (show <$> attrs)
+  displayException (UnparsedAttributes attrs) = show (length attrs) ++ " remaining unparsed attributes: \n" ++ intercalate "\n" (show <$> attrs)
 #endif
 
 -- | A monad for parsing attributes. By default, it requires you to deal with
diff --git a/xml-conduit.cabal b/xml-conduit.cabal
--- a/xml-conduit.cabal
+++ b/xml-conduit.cabal
@@ -1,5 +1,5 @@
 name:            xml-conduit
-version:         1.4.0.1
+version:         1.4.0.2
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>, Aristid Breitkreuz <aristidb@googlemail.com>
