From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Takafumi Arakaki Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] json-encode-char bug? Date: Thu, 27 Sep 2012 19:32:58 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1348767216 7334 80.91.229.3 (27 Sep 2012 17:33:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Sep 2012 17:33:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 27 19:33:42 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1THHxu-0001qr-RA for ged-emacs-devel@m.gmane.org; Thu, 27 Sep 2012 19:33:34 +0200 Original-Received: from localhost ([::1]:34031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THHxp-0007Ea-O9 for ged-emacs-devel@m.gmane.org; Thu, 27 Sep 2012 13:33:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THHxm-0007DW-6d for emacs-devel@gnu.org; Thu, 27 Sep 2012 13:33:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THHxg-0007yt-0K for emacs-devel@gnu.org; Thu, 27 Sep 2012 13:33:26 -0400 Original-Received: from mail-qa0-f48.google.com ([209.85.216.48]:50651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THHxf-0007yp-TZ for emacs-devel@gnu.org; Thu, 27 Sep 2012 13:33:19 -0400 Original-Received: by qadc11 with SMTP id c11so2782037qad.0 for ; Thu, 27 Sep 2012 10:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=lv9XqLu/Njwkyx3yMW5Pfor7AJVQjhq2yLJatdAazMo=; b=ywuNeYKEGU3OOtEv8LYA0yGEBeOy2fOLefw2z8zdO47yqeSpOqitO31TWkxUngL7B/ KF12AiD3gDOmV8ul1AaxSjWC1xoUag+xZG44g3UVnh1Jj7LnYYZ2ITT3SqyWg9ukY/xQ HEHsbMGtm6qICxQYZDKno8rFOgvCZ83wVjYgGIXPXXQjnQTuvAOMCYm/7I1+sWmNhFZN E+28O9UMAr2iSCCyLu05Ckgu1LDResHYwlMek7nFtFiW/0U26k67rkAFbcDomZgwPCYA tLDXRkrO04EYteSt8Lw+ph2zZjPIHtHYQCvfKHUrghWF/uHcd4EKnTV71FBClLx4/LzU MwXg== Original-Received: by 10.224.223.13 with SMTP id ii13mr10972768qab.68.1348767199180; Thu, 27 Sep 2012 10:33:19 -0700 (PDT) Original-Received: by 10.224.214.195 with HTTP; Thu, 27 Sep 2012 10:32:58 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: H0vfZcR98FQIG77KPyPoOGgN_bw X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.216.48 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153632 Archived-At: On Thu, Sep 27, 2012 at 3:13 PM, Stefan Monnier wrote: > Actually, ASCII only goes up to 127, so I've changed the 161 to 128 > (now that I think about it, ASCII 127 is DEL which isn't very printable > either so maybe I should have replaced it with 127). Thank you very much for the quick fix. Indeed, json.dumps(unichr(127)) returns '"\\u007f"' in Python, so I guess it's better to change 128 to 127. In browser, JSON.stringify(String.fromCharCode(127)) returns '""', which is raw code I guess. But JSON.stringify(String.fromCharCode(160)) returns '" "', so maybe this is my JS console's problem (node and google chrome) or they are encoded at different stage. Takafumi PS: Sorry to send it twice to you, Stefan. I meant to sent it to emacs-devel.