[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: |
Eli Zaretskii |
Subject: |
Re: master 02bca34: Utilize new string decoding feature in GTK native input |
Date: |
Sat, 19 Feb 2022 11:35:11 +0200 |
> commit 02bca34852b1f9dd2b3e5364274452d377686f6a
> Author: Po Lu <luangruo@yahoo.com>
> AuthorDate: Sat Feb 19 09:18:27 2022 +0800
> Commit: Po Lu <luangruo@yahoo.com>
> CommitDate: Sat Feb 19 09:18:27 2022 +0800
>
> Utilize new string decoding feature in GTK native input
>
> * src/gtkutil.c (xg_im_context_commit): Don't decode strings
> manually using g_utf8_to_ucs4 but pass unibyte string as the
> keystroke event arg instead.
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? If so, we could use our own implementation
instead. 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.
- Re: master 02bca34: Utilize new string decoding feature in GTK native input,
Eli Zaretskii <=