unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] json-encode-char bug?
@ 2012-09-27 10:22 Takafumi Arakaki
  2012-09-27 13:13 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Takafumi Arakaki @ 2012-09-27 10:22 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]

Dear Emacs devs,

I am using json.el for my IPython notebook client in Emacs [1].
json.el works very well but I think I found a bug.  It prints
character 161 (Non-breaking space) as a raw character, but it causes
error when parsing it in Python.  I think it should be escaped in
\uNNNN form.  I attached a patch to fix this problem.

[1] https://github.com/tkf/emacs-ipython-notebook


Best,
Takafumi Arakaki

[-- Attachment #2: json.patch --]
[-- Type: application/octet-stream, Size: 427 bytes --]

diff --git a/lisp/json.el b/lisp/json.el
index f1ee3a5..7d1c96a 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -315,7 +315,7 @@ representation will be parsed correctly."
      (control-char
       (format "\\%c" control-char))
      ;; ASCIIish printable character
-     ((and (> char 31) (< char 161))
+     ((and (> char 31) (< char 160))
       (format "%c" char))
      ;; Fallback: UCS code point in \uNNNN form
      (t

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-27 22:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-27 10:22 [PATCH] json-encode-char bug? Takafumi Arakaki
2012-09-27 13:13 ` Stefan Monnier
2012-09-27 17:32   ` Takafumi Arakaki
2012-09-27 22:55     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).