From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: phst@google.com, emacs-devel@gnu.org
Subject: Re: [PATCH] Improve error reporting when serializing non-Unicode strings to JSON
Date: Sat, 23 Dec 2017 15:07:59 +0000 [thread overview]
Message-ID: <CAArVCkQ25=rRHRiO_KkOhoppisaFdxnm0x17Aq2eufs8+oehSA@mail.gmail.com> (raw)
In-Reply-To: <83r2rljxpg.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 890 bytes --]
Eli Zaretskii <eliz@gnu.org> schrieb am Sa., 23. Dez. 2017 um 16:00 Uhr:
> > Date: Sat, 23 Dec 2017 16:52:16 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: phst@google.com, emacs-devel@gnu.org
> >
> > Btw, doesn't find_charsets_in_text do the same job cleaner and
> > quicker? AFAIU, all you need is make sure there are no characters
> > from the 2 eight-bit-* charsets in the text, or did I miss something?
>
> Ah, I see you test the encoded string, so find_charsets_in_text won't
> do. But maybe find_charsets_in_text could be called on the original
> strings before encoding them, which would be even better?
>
I'd want to avoid that because it makes the coding check mandatory. With my
patch, the additional check only happens in the failure case, when we
signal an error.
Also find_charsets_in_text seems really hard to use and seems overblown for
a simple "is UTF-8" check.
[-- Attachment #2: Type: text/html, Size: 1406 bytes --]
next prev parent reply other threads:[~2017-12-23 15:07 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAArVCkQ25=rRHRiO_KkOhoppisaFdxnm0x17Aq2eufs8+oehSA@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=eliz@gnu.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.