diff --git a/src.lisp b/src.lisp
index ab13bad4a490d76a83fbe13d499e87eef7714d6a..d39d32b249b127e83b6ff8925472923998bb95f1 100644
--- a/src.lisp
+++ b/src.lisp
@@ -355,10 +355,14 @@
 ;; Parsing
 
 (defparameter *excluded-characters*
-    '(;; `delims' (except #\%, because it's handled specially):
+    (append
+     (loop for i from 0 to #x1f
+	   collect (code-char i))
+     '(;; `delims' (except #\%, because it's handled specially):
       #\< #\> #\" #\space #\#
+
       ;; `unwise':
-      #\{ #\} #\| #\\ #\^ #\[ #\] #\`))
+      #\{ #\} #\| #\\ #\^ #\[ #\] #\`)))
 
 (defun reserved-char-vector (chars &key except)
   (do* ((a (make-array 127 :element-type 'bit :initial-element 0))
diff --git a/tests.lisp b/tests.lisp
index b5cbe37e8132ddff3ae926c89c226e0d384811de..77d19612ad56fb7af08b630a51503ad1c5712adb 100644
--- a/tests.lisp
+++ b/tests.lisp
@@ -408,6 +408,16 @@
        :condition-type 'uri-parse-error)
      res)
 
+
+    ;;an escaped newline isn't rendered properly
+    (push
+    `(let ((weird-uri "https://example.com/q?foo%0abar%20baz"))
+       (test
+	weird-uri
+	(puri:render-uri (puri:parse-uri weird-uri) nil)
+	:test #'string=)
+     ) res)
+
     `(progn ,@(nreverse res))))
 
 (defun do-tests ()