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.