# [ibus/scim] Chinese Input in QQ not working



## lockdoc (May 11, 2011)

Hi,

I can type Chinese via ibus or scim throughout all my X applications. So know I open QQ [(net-im/qq) which is a linux binary application] and want to type in the window, I will change my Input Methods by hitting <Ctrl>+<L_SHIFT> on the keyboard, but the input method will not come up.

I fixed this by adding this line to /usr/local/bin/qq:


```
#!/bin/sh
[color="Blue"]export GDK_NATIVE_WINDOWS=true
export GTK_IM_MODULE=xim XMODIFIERS="@im=ibus" QT_IM_MODULE=xi[/color]m
cd /usr/local/libexec/qq
./qq
```

Now If I want to write in QQ I can change the Input method by <Ctrl>+<L_SHIFT> and if I start typing I can see the small overlay with chinese characters popping up, but they will not be put in the qq window and I can hear the system beep every time I try to write.

I started QQ from console to check for errors:

```
(process:72848): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory
Gtk-Message: Failed to load module "gnomesegvhandler": libgnomesegvhandler.so: cannot open shared object file: No such file or directory

[color="blue"]** (qq:72848): WARNING **: Invalid change to preedit string, first=0 length=1 (orig length == 0)

** (qq:72848): WARNING **: Invalid change to preedit string, first=0 length=1 (orig length == 0)
[/color]
```

Each blue line happens to appear just when I start to write a chinese character.

Another thing is, that in every X Application I can change the Input Method in a Text Field by right clicking and selecting by the following menu. I can also by right-clicking choose my input Methods in every window that supports Text Input.


```
Input Methods -> [X] System (IBus (System Intelligent Input))
                 [ ] None
                 ...
                 [ ] IBus (System Intelligent Input)
                 [ ] Scim  Input Methods
                 ...
```

If I right-click in the QQ Window the ibus and scim input method are not there. Is this a Linux Binary Problem, a QQ Problem, or what is it and how can I fix this?


----------



## Ami (Nov 25, 2011)

Hi, I had the same problem, but I make it work now.

here is my /etc/profile file:


```
export XMODIFIERS="@im=SCIM"
export LANG="en_US.UTF-8"
export LC_CTYPE="zh_CN.UTF-8"
```

and /etc/csh.cshrc


```
setenv XMODIFIERS @im=SCIM
setenv LANG en_US.UTF-8
setenv LC_CTYPE  zh_CN.UTF-8
```

and I also do something like this:


```
/compat/linux/usr/bin/localedef -i zh_CN -f UTF-8 zh_CN
```

when I run *qq* in command line, the same error and still can't input Chinese:

```
$ qq

(process:1390): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory
Gtk-Message: Failed to load module "gnomesegvhandler": libgnomesegvhandler.so: cannot open shared object file: No such file or directory
```


if I set System-wide LANG "zh_CN.UTF-8", the Chinese input will work, but I don't want to show all menu in Chinese, so I don't do this.

I make a qq file too, my qq file is like this:

```
#!/bin/sh
export LANG="zh_CN.UTF-8"
export LC_CTYPE="zh_CN.UTF-8"

cd /usr/local/libexec/qq

./qq &
```

and now I run my qq file:

```
$ ./qq
$ Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: æ— æ³•æ‰“å¼€å…±äº«å¯¹è±¡æ–‡ä»¶: æ²¡æœ‰é‚£ä¸ªæ–‡ä»¶æˆ–ç›®å½•
Gtk-Message: Failed to load module "gnomesegvhandler": libgnomesegvhandler.so: æ— æ³•æ‰“å¼€å…±äº«å¯¹è±¡æ–‡ä»¶: æ²¡æœ‰é‚£ä¸ªæ–‡ä»¶æˆ–ç›®å½•
```

Although still the same error, but it works now.


----------

