Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Try to fix utf-8 brokenness

  • Loading branch information...
commit eacf9bcbece95c5e837f1d414c724132a71244ae 1 parent 4516980
Gregory Collins authored
Showing with 10 additions and 7 deletions.
  1. +3 −1 blaaargh.cabal
  2. +7 −6 src/Blaaargh/Internal/Types.hs
4 blaaargh.cabal
View
@@ -1,5 +1,5 @@
Name: Blaaargh
-Version: 0.3
+Version: 0.3.1
Synopsis: A simple filesystem-based content management system for Happstack
License: GPL
License-file: COPYING
@@ -42,6 +42,7 @@ Library
split,
time,
unix,
+ utf8-string,
xml
@@ -68,4 +69,5 @@ Executable blaaargh
split,
time,
unix,
+ utf8-string,
xml
13 src/Blaaargh/Internal/Types.hs
View
@@ -40,7 +40,7 @@ import Blaaargh.Internal.Time
import Blaaargh.Internal.Util.ExcludeList
import Blaaargh.Internal.Util.Templates
-
+import qualified Data.ByteString.UTF8 as UTF8
-- to make things super-easy on us, we'll define our internal post
-- format to be the same as our Atom feed.
@@ -56,19 +56,20 @@ getPostTime (Post p) = parseAtomTime $ fromMaybe upd pub
instance ToSElem Atom.EntryContent where
- toSElem (Atom.TextContent s) = toSElem s
- toSElem (Atom.HTMLContent s) = toSElem s
+ toSElem (Atom.TextContent s) = toSElem $ UTF8.fromString s
+ toSElem (Atom.HTMLContent s) = toSElem $ UTF8.fromString s
toSElem _ = toSElem (""::String)
instance ToSElem Atom.TextContent where
- toSElem (Atom.TextString s) = toSElem s
- toSElem (Atom.HTMLString s) = toSElem s
+ toSElem (Atom.TextString s) = toSElem $ UTF8.fromString s
+ toSElem (Atom.HTMLString s) = toSElem $ UTF8.fromString s
toSElem _ = toSElem (""::String)
instance ToSElem Atom.Person where
- toSElem (Atom.Person name _ email _) = toSElem $ name ++ em
+ toSElem (Atom.Person name _ email _) =
+ toSElem $ UTF8.fromString $ name ++ em
where
em = maybe "" (\e -> " <" ++ e ++ ">") email
Please sign in to comment.
Something went wrong with that request. Please try again.