unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: emacs-devel@gnu.org
Cc: Philipp Stephani <phst@google.com>
Subject: Re: [PATCH] Improve error reporting when serializing non-Unicode strings to JSON
Date: Sat, 30 Dec 2017 22:20:26 +0000	[thread overview]
Message-ID: <CAArVCkQAfv2Mj14S8QZMiczyRkiPpj3jtzzhSp9M1ENRKipApg@mail.gmail.com> (raw)
In-Reply-To: <20171223165857.25743-1-phst@google.com>

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

Philipp Stephani <p.stephani2@gmail.com> schrieb am Sa., 23. Dez. 2017 um
17:59 Uhr:

> * src/coding.h (EOL_SEEN_NONE, EOL_SEEN_LF, EOL_SEEN_CR)
> (EOL_SEEN_CRLF): Move from coding.c.
>
> * src/coding.c (check_utf_8): Make extern.
>
> * src/json.c (json_check_utf8): New helper function.
> (lisp_to_json_toplevel_1, lisp_to_json): Use it.  To save a bit of
> time, check for invalid UTF-8 strings only after encountering an
> error, since Jansson already rejects them.
>
> * test/src/json-tests.el (json-serialize/invalid-unicode): Adapt
> expected error symbol.
>

I've pushed a slight variant of this patch to master as a5835dfee1. The
only difference is that the UTF-8 check is factored out into a helper
function in coding.c.

[-- Attachment #2: Type: text/html, Size: 1060 bytes --]

  reply	other threads:[~2017-12-30 22:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22 21:00 [PATCH] Improve error reporting when serializing non-Unicode strings to JSON Philipp Stephani
2017-12-23  8:28 ` Eli Zaretskii
2017-12-23 12:33   ` Philipp Stephani
2017-12-23 13:44     ` Eli Zaretskii
2017-12-23 14:29       ` Philipp Stephani
2017-12-23 14:52         ` Eli Zaretskii
2017-12-23 15:00           ` Eli Zaretskii
2017-12-23 15:07             ` Philipp Stephani
2017-12-23 15:19           ` Philipp Stephani
2017-12-23 15:34             ` Eli Zaretskii
2017-12-23 16:20               ` Philipp Stephani
2017-12-23 16:36                 ` Eli Zaretskii
2017-12-23 16:58                   ` Philipp Stephani
2017-12-23 16:58                     ` Philipp Stephani
2017-12-30 22:20                       ` Philipp Stephani [this message]
2017-12-31 15:52                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAArVCkQAfv2Mj14S8QZMiczyRkiPpj3jtzzhSp9M1ENRKipApg@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=phst@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).