Bug Hunting Session
Bug 122329 - When inputting Chinese in CODE, it would show double words instead of one with each input
Summary: When inputting Chinese in CODE, it would show double words instead of one wit...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium critical
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0
Keywords:
: 122795 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-12-26 05:02 UTC by Franklin Weng
Modified: 2019-05-18 01:01 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Video screencast when inputting Chinese characters (1.86 MB, video/webm)
2018-12-26 05:02 UTC, Franklin Weng
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franklin Weng 2018-12-26 05:02:22 UTC
Created attachment 147825 [details]
Video screencast when inputting Chinese characters

When I input Chinese characters in Writer/Calc/Impress... in CODE 4.0, it will show double words instead of one with each input.

A screencast video is attached.
Comment 1 Andras Timar 2018-12-27 11:31:22 UTC
The bug is not reproducible on Windows. It must be some strange interaction of IME and browser on Linux.
Comment 2 Andras Timar 2018-12-27 11:46:56 UTC
@Franklin: what is your IME software? I tried on my openSUSE, and my IME looked different, and also it worked OK with CODE.
Comment 3 Franklin Weng 2018-12-27 11:50:24 UTC
(In reply to Andras Timar from comment #2)
> @Franklin: what is your IME software? I tried on my openSUSE, and my IME
> looked different, and also it worked OK with CODE.

gcin, running on Kubuntu 18.04.
Comment 4 Aron Budea 2019-01-02 12:25:52 UTC
Franklin, could you please share instructions on how to set up and use gcin? Installing it is easy, but when it comes to using the tool, unfortunately not so much.
Comment 5 Franklin Weng 2019-01-02 12:43:46 UTC
(In reply to Aron Budea from comment #4)
> Franklin, could you please share instructions on how to set up and use gcin?
> Installing it is easy, but when it comes to using the tool, unfortunately
> not so much.

After installing gcin

1. make sure you are under locale zh_TW.UTF-8 (so you should probably install ubuntu with zh_TW)
2. there should be two files: 26_gcin.conf and 26_gcin.rc under /usr/share/im-config/data
3. run im-config with your own account (not root) to select user input method.  You can probably override LC_ALL=C im-config to understand the messages.  Answer Yes in the second window then choose gcin.
4. logout (restart X-window or dm) and login again
5. make sure the following environment variables are set:

$ env | grep IM
CLUTTER_IM_MODULE=xim
QT4_IM_MODULE=gcin
QT_IM_MODULE=gcin
GTK_IM_MODULE=gcin
Comment 6 Aron Budea 2019-01-04 19:55:20 UTC
(In reply to Franklin Weng from comment #5)
> After installing gcin
Thank you for the detailed steps! What is still unclear to me, how do I switch between English and Chinese layouts?

However, in the meantime I managed to reproduce the bug with other input methods as well. Apparently the bug only occurs with Chrome/Chrome-based browsers.
Comment 7 Franklin Weng 2019-01-05 02:45:36 UTC
(In reply to Aron Budea from comment #6)
> (In reply to Franklin Weng from comment #5)
> > After installing gcin
> Thank you for the detailed steps! What is still unclear to me, how do I
> switch between English and Chinese layouts?

Ctrl-space can switch between English and Chinese input mode.
Ctrl-Alt-1, Ctrl-Alt-3, ... can directly switch to certain Chinese input method, and then Ctrl-space can switch back to English.

BTW, that's why the shortcut key "Ctrl-space" in Calc can not be used in CJK because it conflicts with our input method engine.  But that's another topic.

> 
> However, in the meantime I managed to reproduce the bug with other input
> methods as well. Apparently the bug only occurs with Chrome/Chrome-based
> browsers.

Yes, I found it too.  I can input normally in Firefox but not in Google chrome.
Comment 8 Aron Budea 2019-01-20 18:15:52 UTC
*** Bug 122795 has been marked as a duplicate of this bug. ***
Comment 9 Babbles 2019-03-13 07:01:17 UTC
I also have this same problem with Chromium based browsers.
This phenomenon does not occur with Firefox. And in Calc, there is no problem with Chromium based when inputting characters into the text input section at the top, not in cells.

Since the timing* when the input method changed in the smartphone version (or narrow window display on desktop PC), but iOS has a problem with input.
*When the blue input mode button is on the lower right of the screen.

There is no problem if the user naturally inputs 2-byte characters. An error occurs when the user tries to convert characters into Chinese characters.
When the user converts an input character into Chinese characters, first, all characters before conversion are input as they are. Then, only one Chinese character(1 word) is added to the end of the previous character. All characters after the second character after Chinese characters conversion are cut.
I want the smartphone version to revert to the old system.
Comment 10 Babbles 2019-03-20 01:12:38 UTC
When the window size is narrowed by desktop PC, it changes to the smartphone mode. Blue input button displayed at the bottom right.
At this time, if the user inputs Chinese characters ignoring the blue button, this problem does not seem to occur by Chromium based browser.
Comment 11 Aron Budea 2019-05-13 00:32:00 UTC
Should be fixed by the following two commits. Thanks to Henry Castro for the fixes.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=c36e7f44c2e1b97d9073560a1734d3f6628ac85a
author		Henry Castro <hcastro@collabora.com>	2019-04-11 14:22:15 -0400
committer	Henry Castro <hcastro@collabora.com>	2019-04-12 15:26:56 +0200

lok: add missing parameter to PostExtTextInputEvent function

https://cgit.freedesktop.org/libreoffice/online/commit/?id=6987c3509c47a063a36311a5826fc4c4131846da
author		Henry Castro <hcastro@collabora.com>	2019-04-11 14:12:32 -0400
committer	Henry Castro <hcastro@collabora.com>	2019-04-12 15:24:42 +0200

loleaflet: fix the input method when receives 'compositionend' event
Comment 12 Franklin Weng 2019-05-18 01:01:48 UTC
Fixed in CODE confirmed.  Thanks.