Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Try to fix utf-8 brokenness

  • Loading branch information...
commit eacf9bcbece95c5e837f1d414c724132a71244ae 1 parent 4516980
Gregory Collins authored

Showing 2 changed files with 10 additions and 7 deletions. Show diff stats Hide diff stats

  1. +3 1 blaaargh.cabal
  2. +7 6 src/Blaaargh/Internal/Types.hs
4 blaaargh.cabal
... ... @@ -1,5 +1,5 @@
1 1 Name: Blaaargh
2   -Version: 0.3
  2 +Version: 0.3.1
3 3 Synopsis: A simple filesystem-based content management system for Happstack
4 4 License: GPL
5 5 License-file: COPYING
@@ -42,6 +42,7 @@ Library
42 42 split,
43 43 time,
44 44 unix,
  45 + utf8-string,
45 46 xml
46 47
47 48
@@ -68,4 +69,5 @@ Executable blaaargh
68 69 split,
69 70 time,
70 71 unix,
  72 + utf8-string,
71 73 xml
13 src/Blaaargh/Internal/Types.hs
@@ -40,7 +40,7 @@ import Blaaargh.Internal.Time
40 40 import Blaaargh.Internal.Util.ExcludeList
41 41 import Blaaargh.Internal.Util.Templates
42 42
43   -
  43 +import qualified Data.ByteString.UTF8 as UTF8
44 44
45 45 -- to make things super-easy on us, we'll define our internal post
46 46 -- format to be the same as our Atom feed.
@@ -56,19 +56,20 @@ getPostTime (Post p) = parseAtomTime $ fromMaybe upd pub
56 56
57 57
58 58 instance ToSElem Atom.EntryContent where
59   - toSElem (Atom.TextContent s) = toSElem s
60   - toSElem (Atom.HTMLContent s) = toSElem s
  59 + toSElem (Atom.TextContent s) = toSElem $ UTF8.fromString s
  60 + toSElem (Atom.HTMLContent s) = toSElem $ UTF8.fromString s
61 61 toSElem _ = toSElem (""::String)
62 62
63 63
64 64 instance ToSElem Atom.TextContent where
65   - toSElem (Atom.TextString s) = toSElem s
66   - toSElem (Atom.HTMLString s) = toSElem s
  65 + toSElem (Atom.TextString s) = toSElem $ UTF8.fromString s
  66 + toSElem (Atom.HTMLString s) = toSElem $ UTF8.fromString s
67 67 toSElem _ = toSElem (""::String)
68 68
69 69
70 70 instance ToSElem Atom.Person where
71   - toSElem (Atom.Person name _ email _) = toSElem $ name ++ em
  71 + toSElem (Atom.Person name _ email _) =
  72 + toSElem $ UTF8.fromString $ name ++ em
72 73 where
73 74 em = maybe "" (\e -> " <" ++ e ++ ">") email
74 75

0 comments on commit eacf9bc

Please sign in to comment.
Something went wrong with that request. Please try again.