diff options
| author | Stefan Monnier | 2012-09-27 09:10:54 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-09-27 09:10:54 -0400 |
| commit | 9cad61d6db2b2a89f99eddcb88f09a209e59cc8c (patch) | |
| tree | b2d30dca65c526f6ba8bbba3ec6e78bb1490e912 | |
| parent | f077f61d681b15e91b9ecd8ad3aab646d293f2c1 (diff) | |
| download | emacs-9cad61d6db2b2a89f99eddcb88f09a209e59cc8c.tar.gz emacs-9cad61d6db2b2a89f99eddcb88f09a209e59cc8c.zip | |
* lisp/json.el (json-encode-char): Codes 128-160 aren't "ASCII printable".
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/json.el | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f259ec2b3fa..079a3feaea1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-09-27 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * json.el (json-encode-char): Codes 128-160 aren't "ASCII printable". | ||
| 4 | |||
| 1 | 2012-09-27 Glenn Morris <rgm@gnu.org> | 5 | 2012-09-27 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * faces.el (x-display-name): Declare (for without-x builds). | 7 | * 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." | |||
| 311 | (setq char (json-encode-char0 char 'ucs)) | 311 | (setq char (json-encode-char0 char 'ucs)) |
| 312 | (let ((control-char (car (rassoc char json-special-chars)))) | 312 | (let ((control-char (car (rassoc char json-special-chars)))) |
| 313 | (cond | 313 | (cond |
| 314 | ;; Special JSON character (\n, \r, etc.) | 314 | ;; Special JSON character (\n, \r, etc.). |
| 315 | (control-char | 315 | (control-char |
| 316 | (format "\\%c" control-char)) | 316 | (format "\\%c" control-char)) |
| 317 | ;; ASCIIish printable character | 317 | ;; ASCIIish printable character. |
| 318 | ((and (> char 31) (< char 161)) | 318 | ((and (> char 31) (< char 128)) |
| 319 | (format "%c" char)) | 319 | (format "%c" char)) |
| 320 | ;; Fallback: UCS code point in \uNNNN form | 320 | ;; Fallback: UCS code point in \uNNNN form. |
| 321 | (t | 321 | (t |
| 322 | (format "\\u%04x" char))))) | 322 | (format "\\u%04x" char))))) |
| 323 | 323 | ||