Bug 1002417 - Can not input Chinese character with ibus, showing Invalid UTF-8
Summary: Can not input Chinese character with ibus, showing Invalid UTF-8
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: ibus-pinyin
Version: 19
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Peng Wu
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-29 07:28 UTC by Aaron Lu
Modified: 2013-09-09 05:52 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-09 05:52:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Screenshot of locale command (238.02 KB, image/jpeg)
2013-08-30 05:24 UTC, Aaron Lu
no flags Details

Description Aaron Lu 2013-08-29 07:28:41 UTC
Description of problem:
Run im-chooser and then select ibus, add pinyin input method, then switch to Chinese pinyin mode and type word. The indicator window can correctly show the Chinese word, when I hit space to send these words, they appeared as [Invalid UTF-8].

Version-Release number of selected component (if applicable):
$ rpm -qa |grep ibus
ibus-pinyin-1.5.0-2.fc19.x86_64
libusbx-1.0.16-3.fc19.x86_64
ibus-gtk3-1.5.3-1.fc19.x86_64
ibus-m17n-1.3.4-10.fc19.x86_64
ibus-1.5.3-1.fc19.x86_64
libusb-0.1.5-2.fc19.x86_64
libusal-1.1.11-19.fc19.x86_64
ibus-gtk2-1.5.3-1.fc19.x86_64
ibus-libs-1.5.3-1.fc19.x86_64
ibus-setup-1.5.3-1.fc19.noarch
libuser-0.59-1.fc19.x86_64
libuser-python-0.59-1.fc19.x86_64
libuser-devel-0.59-1.fc19.x86_64


How reproducible:
Always

Steps to Reproduce:
1. Switch to Chinese pinyin mode
2. Type Chinese words
3. Press space to send out the words

Actual results:
[Invalid UTF-8] appeared

Expected results:
Typed Chinese words appeared

Additional info:

Comment 1 Peng Wu 2013-08-29 07:58:10 UTC
Which application are you using to input Chinese characters?

Comment 2 Aaron Lu 2013-08-29 15:06:56 UTC
I used mate-terminal. The problematic system is my office desktop, I just tried it on my home computer, there is no problem...Don't know why, any hint?

This is the list of ibus installation on my home computer:
[aaron@r61i ~]$ rpm -qa |grep ibus
libusal-1.1.11-19.fc19.x86_64
ibus-libs-1.5.3-1.fc19.x86_64
ibus-gtk2-1.5.3-1.fc19.x86_64
ibus-1.5.3-1.fc19.x86_64
libusbx-1.0.16-3.fc19.x86_64
libuser-0.59-1.fc19.x86_64
ibus-pinyin-1.5.0-2.fc19.x86_64
libusb-0.1.5-2.fc19.x86_64
ibus-gtk3-1.5.3-1.fc19.x86_64
libuser-python-0.59-1.fc19.x86_64
ibus-setup-1.5.3-1.fc19.noarch

But there are other packages needs updated on this system, while on the problematic office system, it is fully updated. I'll update my home computer with yum and then report back, thanks for the quick response!

Comment 3 Aaron Lu 2013-08-29 15:15:06 UTC
My home computer is fully updated, still no problem. So looks like a per user configure issue?

Comment 4 Peng Wu 2013-08-30 03:21:16 UTC
Does a new account still have the problem?
Maybe it is a locale-related problem, tried to re-start your computer?
Please provides the output of the following command:
$ locale
Maybe a screenshot will help to analyze it.

Comment 5 Aaron Lu 2013-08-30 05:24:50 UTC
Created attachment 792023 [details]
Screenshot of locale command

A newly created account doesn't have this problem...

The [Invalid UTF-8] character is shown by sending a Chinese word to the terminal with ibus, I leave it there for the illustration. The ibus_test is the newly created user, looks like it has problem too in my account's environment.

Comment 6 Aaron Lu 2013-08-30 05:38:17 UTC
I just tried:
1 delete .config .cache .local directories and then logout;
2 log in, used im-chooser to select ibus, then logout;
3 log in, problem still there.

A weird thing in step 2 is, when I select ibus and then plan to add pinyin mode, just found that pinyin was already there. It seems it remembered something that I didn't remove entirely. Hope this helps.

Comment 7 Aaron Lu 2013-08-30 05:46:16 UTC
Good news, this time, in addition to the above mentioned directories, I also removed .icons .themes and ibus doesn't remember I've added pinyin before and Chinese words can be sent to the app now!

Any idea of why and what could possibly be the cause? But since it is resolved now, feel free to close it. But if you want to find out why and needs me to do anything, I would be glad to help. Thanks.

Comment 8 Aaron Lu 2013-08-30 05:50:11 UTC
OK, this is crazy. After I played with some preference options of ibus-pinyin like changing width from half to full, etc. The problem is back...

Comment 9 Aaron Lu 2013-08-30 05:58:30 UTC
Found a way to reproduce the bug:
1 remove all config files .config .cache .local .icons .themes and log out(or create a new user);
2 log in, use im-chooser to select ibus as the input method, then add pinyin, then log out;
3 log in, open terminal, Chinese input works; then select pinyin preference, change width from half to full, then test again, Chinese input still works; then right click ibus icon on the panel, select restart; then Chinese input will become [Invalid UTF-8].

Comment 10 Peng Wu 2013-08-30 06:08:42 UTC
Thanks for the information, I will have a try.

So it needs "ibus restart" to re-produce this problem?

Comment 11 Aaron Lu 2013-08-30 06:43:17 UTC
(In reply to Peng Wu from comment #10)
> Thanks for the information, I will have a try.
> 
> So it needs "ibus restart" to re-produce this problem?

Yes, both preference setting change and restart are required to reproduce the problem.

Comment 12 fujiwara 2013-09-02 10:28:41 UTC
I cannot reproduce your problem.
Which do you mean some specific Chinese characters cause your problem or any Chinese characters do?

If some chars only, probably we need to know the type sequeces with pinyin.

Probably I think It failed in g_variant_new_string() and maybe g_utf8_validate() is failed internally.
https://git.gnome.org/browse/glib/tree/glib/gvariant.c#n4195

It might be useful to provide a custom glib2 to output the failed string.
If you could debug /usr/libexec/ibus-engine-pinyin or ibus-daemon when you try to output Chinese and connect g_variant_valist_new_nnp(), it would be great.

Comment 13 Aaron Lu 2013-09-03 00:18:13 UTC
(In reply to fujiwara from comment #12)
> I cannot reproduce your problem.
> Which do you mean some specific Chinese characters cause your problem or any
> Chinese characters do?

Any Chinese characters do.

> 
> If some chars only, probably we need to know the type sequeces with pinyin.
> 
> Probably I think It failed in g_variant_new_string() and maybe
> g_utf8_validate() is failed internally.
> https://git.gnome.org/browse/glib/tree/glib/gvariant.c#n4195
> 
> It might be useful to provide a custom glib2 to output the failed string.
> If you could debug /usr/libexec/ibus-engine-pinyin or ibus-daemon when you
> try to output Chinese and connect g_variant_valist_new_nnp(), it would be
> great.

I'm not sure how I'm supposed to do this, any instructions? Thanks.

Comment 14 Peng Wu 2013-09-09 05:36:55 UTC
Sorry, I finally tried the mate-desktop on Fedora 19.
The ibus-pinyin have the problem, but ibus-libpinyin doesn't.
Please try ibus-libpinyin instead, ibus-pinyin is in maintenance mode now.

Comment 15 Aaron Lu 2013-09-09 05:52:06 UTC
Great, libpinyin works well, thanks for the information.

It's just, for an innocent normal user, when he does:
$ sudo yum search ibus
ibus-pinyin.x86_64 : The Chinese Pinyin and Bopomofo engines for IBus input platform
ibus-libpinyin.x86_64 : Intelligent Pinyin engine based on libpinyin for IBus

The ibus-pinyin seems to have a better chance of being installed since the ibus-libpinyin feels more like a library to be used by ibus-pinyin. Oh I just checked Fedora release notes, the F18 release note mentioned this, so I missed something, sorry for that.

Thanks for the hint and I can finally input Chinese now!


Note You need to log in before you can comment on or make changes to this bug.