emacs-devel
[Top][All Lists]
Advanced

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

Re: master 02bca34: Utilize new string decoding feature in GTK native in


From: Po Lu
Subject: Re: master 02bca34: Utilize new string decoding feature in GTK native input
Date: Sat, 19 Feb 2022 18:09:38 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Is this a good idea?  Consing a string when we process input increases
> GC pressure, and what issues does this change solve as a
> counter-weight for that disadvantage?  Is g_utf8_to_ucs4 a problematic
> API or something?

No, but some input method modules don't always return valid UTF-8 like
they're supposed to, thereby causing crashes in g_utf8_to_ucs4_fast.

I should have explained that in the commit message.

> But in general, decoding UTF-8 encoded C string is better done without
> consing a string and then using the coding.c stuff.  After all, if the
> original string is 100% guaranteed to be in UTF-8, the decoding is
> almost trivial.

It's supposedly guaranteed, but some input method modules break that
guarantee.

Thanks.


reply via email to

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