From: Stefan Monnier Date: Thu, 27 Sep 2012 13:10:54 +0000 (-0400) Subject: * lisp/json.el (json-encode-char): Codes 128-160 aren't "ASCII printable". X-Git-Tag: emacs-24.2.90~244^2~56 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9cad61d6db2b2a89f99eddcb88f09a209e59cc8c;p=emacs.git * lisp/json.el (json-encode-char): Codes 128-160 aren't "ASCII printable". --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f259ec2b3fa..079a3feaea1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-09-27 Stefan Monnier + + * json.el (json-encode-char): Codes 128-160 aren't "ASCII printable". + 2012-09-27 Glenn Morris * faces.el (x-display-name): Declare (for without-x builds). diff --git a/lisp/json.el b/lisp/json.el index f1ee3a52032..1a70d0b40ce 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -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)))))