* lisp/json.el (json-encode-char): Codes 128-160 aren't "ASCII printable".
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 27 Sep 2012 13:10:54 +0000 (09:10 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 27 Sep 2012 13:10:54 +0000 (09:10 -0400)
lisp/ChangeLog
lisp/json.el

index f259ec2..079a3fe 100644 (file)
@@ -1,3 +1,7 @@
+2012-09-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * json.el (json-encode-char): Codes 128-160 aren't "ASCII printable".
+
 2012-09-27  Glenn Morris  <rgm@gnu.org>
 
        * faces.el (x-display-name): Declare (for without-x builds).
index f1ee3a5..1a70d0b 100644 (file)
@@ -311,13 +311,13 @@ representation will be parsed correctly."
   (setq char (json-encode-char0 char 'ucs))
   (let ((control-char (car (rassoc char json-special-chars))))
     (cond
-     ;; Special JSON character (\n, \r, etc.)
+     ;; Special JSON character (\n, \r, etc.).
      (control-char
       (format "\\%c" control-char))
-     ;; ASCIIish printable character
-     ((and (> char 31) (< char 161))
+     ;; ASCIIish printable character.
+     ((and (> char 31) (< char 128))
       (format "%c" char))
-     ;; Fallback: UCS code point in \uNNNN form
+     ;; Fallback: UCS code point in \uNNNN form.
      (t
       (format "\\u%04x" char)))))