emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Improve error reporting when serializing non-Unicode strings


From: Philipp Stephani
Subject: Re: [PATCH] Improve error reporting when serializing non-Unicode strings to JSON
Date: Sat, 23 Dec 2017 15:07:59 +0000



Eli Zaretskii <address@hidden> schrieb am Sa., 23. Dez. 2017 um 16:00 Uhr:
> Date: Sat, 23 Dec 2017 16:52:16 +0200
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden, address@hidden
>
> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]