mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-07 15:00:34 -08:00
* lisp/json.el (json-encode-char): Codes 128-160 aren't "ASCII printable".
This commit is contained in:
parent
f077f61d68
commit
9cad61d6db
2 changed files with 8 additions and 4 deletions
|
|
@ -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>
|
2012-09-27 Glenn Morris <rgm@gnu.org>
|
||||||
|
|
||||||
* faces.el (x-display-name): Declare (for without-x builds).
|
* faces.el (x-display-name): Declare (for without-x builds).
|
||||||
|
|
|
||||||
|
|
@ -311,13 +311,13 @@ representation will be parsed correctly."
|
||||||
(setq char (json-encode-char0 char 'ucs))
|
(setq char (json-encode-char0 char 'ucs))
|
||||||
(let ((control-char (car (rassoc char json-special-chars))))
|
(let ((control-char (car (rassoc char json-special-chars))))
|
||||||
(cond
|
(cond
|
||||||
;; Special JSON character (\n, \r, etc.)
|
;; Special JSON character (\n, \r, etc.).
|
||||||
(control-char
|
(control-char
|
||||||
(format "\\%c" control-char))
|
(format "\\%c" control-char))
|
||||||
;; ASCIIish printable character
|
;; ASCIIish printable character.
|
||||||
((and (> char 31) (< char 161))
|
((and (> char 31) (< char 128))
|
||||||
(format "%c" char))
|
(format "%c" char))
|
||||||
;; Fallback: UCS code point in \uNNNN form
|
;; Fallback: UCS code point in \uNNNN form.
|
||||||
(t
|
(t
|
||||||
(format "\\u%04x" char)))))
|
(format "\\u%04x" char)))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue