diff --git a/ginger.cabal b/ginger.cabal
--- a/ginger.cabal
+++ b/ginger.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                ginger
-version:             0.3.9.0
+version:             0.3.9.1
 synopsis:            An implementation of the Jinja2 template language in Haskell
 description:         Ginger is Jinja, minus the most blatant pythonisms. Wants
                      to be feature complete, but isn't quite there yet.
@@ -15,7 +15,9 @@
 category:            Text
 build-type:          Simple
 -- extra-source-files:
+data-files: test/fixtures/*.json
 cabal-version:       >=1.10
+bug-reports:         https://github.com/tdammers/ginger/issues
 
 library
   exposed-modules: Text.Ginger
diff --git a/src/Text/Ginger/AST.hs b/src/Text/Ginger/AST.hs
--- a/src/Text/Ginger/AST.hs
+++ b/src/Text/Ginger/AST.hs
@@ -39,6 +39,7 @@
     | LiteralS Html -- ^ Literal output (anything outside of any tag)
     | InterpolationS Expression -- ^ {{ expression }}
     | IfS Expression Statement Statement -- ^ {% if expression %}statement{% else %}statement{% endif %}
+    | SwitchS Expression [(Expression, Statement)] Statement -- ^ {% switch expression %}{% case expression %}statement{% endcase %}...{% default %}statement{% enddefault %}{% endswitch %}
     | ForS (Maybe VarName) VarName Expression Statement -- ^ {% for index, varname in expression %}statement{% endfor %}
     | SetVarS VarName Expression -- ^ {% set varname = expr %}
     | DefMacroS VarName Macro -- ^ {% macro varname %}statements{% endmacro %}
diff --git a/src/Text/Ginger/Parse.hs b/src/Text/Ginger/Parse.hs
--- a/src/Text/Ginger/Parse.hs
+++ b/src/Text/Ginger/Parse.hs
@@ -197,6 +197,7 @@
 statementP = interpolationStmtP
            <|> commentStmtP
            <|> ifStmtP
+           <|> switchStmtP
            <|> setStmtP
            <|> forStmtP
            <|> includeP
@@ -257,6 +258,25 @@
     -- No endif here: the parent {% if %} owns that one.
     return $ IfS condExpr trueStmt falseStmt
 
+switchStmtP :: Monad m => Parser m Statement
+switchStmtP = do
+    pivotExpr <- try $ fancyTagP "switch" expressionP
+    cases <- many switchCaseP
+    def <- option NullS $ switchDefaultP
+    simpleTagP "endswitch"
+    return $ SwitchS pivotExpr cases def
+
+switchCaseP :: Monad m => Parser m (Expression, Statement)
+switchCaseP = do
+    cmpExpr <- try $ fancyTagP "case" expressionP
+    body <- statementsP
+    simpleTagP "endcase"
+    return (cmpExpr, body)
+
+switchDefaultP :: Monad m => Parser m Statement
+switchDefaultP = do
+    try (simpleTagP "default") *> statementsP <* simpleTagP "enddefault"
+
 setStmtP :: Monad m => Parser m Statement
 setStmtP = fancyTagP "set" setStmtInnerP
 
@@ -706,6 +726,7 @@
             c2 <- anyChar
             case c2 of
                 'n' -> return '\n'
+                'r' -> return '\r'
                 'b' -> return '\b'
                 'v' -> return '\v'
                 '0' -> return '\0'
diff --git a/src/Text/Ginger/Run.hs b/src/Text/Ginger/Run.hs
--- a/src/Text/Ginger/Run.hs
+++ b/src/Text/Ginger/Run.hs
@@ -250,6 +250,24 @@
     cond <- runExpression condExpr
     runStatement $ if toBoolean cond then true else false
 
+runStatement (SwitchS pivotExpr cases def) = do
+    pivot <- runExpression pivotExpr
+    let branches =
+            [ \cont -> do
+                cond <- runExpression condExpr
+                if pivot `looseEquals` cond
+                    then runStatement body
+                    else cont
+            | (condExpr, body)
+            <- cases
+            ] ++
+            [ Prelude.const (runStatement def)
+            ]
+    go branches
+    where
+        go [] = return ()
+        go (x:xs) = x (go xs)
+
 runStatement (SetVarS name valExpr) = do
     val <- runExpression valExpr
     setVar name val
diff --git a/test/Text/Ginger/SimulationTests.hs b/test/Text/Ginger/SimulationTests.hs
--- a/test/Text/Ginger/SimulationTests.hs
+++ b/test/Text/Ginger/SimulationTests.hs
@@ -38,8 +38,12 @@
             [] [] "- {%- set x=1 -%} -" "--"
         ]
     , testGroup "Literals"
-        [ testCase "String: \"foobar\"" $ mkTestHtml
-            [] [] "{{ \"foobar\" }}" "foobar"
+        [ testGroup "Strings"
+            [ testCase "String: \"foobar\"" $ mkTestHtml
+                [] [] "{{ \"foobar\" }}" "foobar"
+            , testCase "String: \"\\r\\n\\t\\b\"" $ mkTestHtml
+                [] [] "{{ \"\\r\\n\\t\\b\" }}" "\r\n\t\b"
+            ]
         , testGroup "Numbers"
             [ testCase "123" $ mkTestHtml
                 [] [] "{{ 123 }}" "123"
@@ -166,6 +170,25 @@
             mkTestHtml [] [] "{% if false %}yes{% elif false %}maybe{% else %}no{% endif %}" "no"
         , testCase "if false then \"yes\" else if true then \"maybe\" else \"no\"" $ do
             mkTestHtml [] [] "{% if false %}yes{% elif true %}maybe{% else %}no{% endif %}" "maybe"
+        ]
+    , testGroup "Switch"
+        [ testCase "switch 1 of 1, 2, default" $ do
+            mkTestHtml [] []
+                ( "{% switch 1 %}\n" ++
+                  "{% case 1 %}One{% endcase %}\n" ++
+                  "{% case 2 %}Two{% endcase %}\n" ++
+                  "{% default %}Default{% enddefault %}\n" ++
+                  "{% endswitch %}\n"
+                )
+                "One"
+        , testCase "switch 1 of 1, 2" $ do
+            mkTestHtml [] []
+                ( "{% switch 1 %}\n" ++
+                  "{% case 1 %}One{% endcase %}\n" ++
+                  "{% case 2 %}Two{% endcase %}\n" ++
+                  "{% endswitch %}\n"
+                )
+                "One"
         ]
     , testGroup "Comparisons"
         [ testCase "if 1 == 1 then \"yes\" else \"no\"" $ do
diff --git a/test/fixtures/silly-locale.json b/test/fixtures/silly-locale.json
new file mode 100644
--- /dev/null
+++ b/test/fixtures/silly-locale.json
@@ -0,0 +1,90 @@
+{
+   "dateTimeFmt" : "It be %A, in the year %y, the clock striketh %H",
+   "wDays" : [
+      [
+         "The Day Of Sunshine",
+         "Sun"
+      ],
+      [
+         "The Day Of Monning",
+         "Mon"
+      ],
+      [
+         "The Day Of Two",
+         "Tue"
+      ],
+      [
+         "The Midst Of The Week",
+         "Wed"
+      ],
+      [
+         "The Day Of Thor",
+         "Thu"
+      ],
+      [
+         "The Day Of Freya",
+         "Fri"
+      ],
+      [
+         "The Day Of Saturn",
+         "Sat"
+      ]
+   ],
+   "amPm" : [
+      "Morning",
+      "Evening"
+   ],
+   "timeFmt" : "%H o'clock",
+   "months" : [
+      [
+         "January",
+         "Jan"
+      ],
+      [
+         "February",
+         "Feb"
+      ],
+      [
+         "March",
+         "Mar"
+      ],
+      [
+         "April",
+         "Apr"
+      ],
+      [
+         "May",
+         "May"
+      ],
+      [
+         "June",
+         "Jun"
+      ],
+      [
+         "July",
+         "Jul"
+      ],
+      [
+         "August",
+         "Aug"
+      ],
+      [
+         "September",
+         "Sep"
+      ],
+      [
+         "October",
+         "Oct"
+      ],
+      [
+         "November",
+         "Nov"
+      ],
+      [
+         "December",
+         "Dec"
+      ]
+   ],
+   "time12Fmt" : "%I:%M:%S %p",
+   "dateFmt" : "%d-%m, %y"
+}
