Bug 147285 - Pasting from Firefox results in raw code (\uXXXX) instead of Chinese text under kf5 (cairo+wayland)
Summary: Pasting from Firefox results in raw code (\uXXXX) instead of Chinese text und...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.2.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:7.4.0 target:7.3.3
Keywords:
Depends on:
Blocks: Wayland KDE Paste
  Show dependency treegraph
 
Reported: 2022-02-08 13:10 UTC by Yuejian MO
Modified: 2022-04-16 15:39 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuejian MO 2022-02-08 13:10:37 UTC
Description:
The LO runs with wayland in openSUSE. If I try to copy text from firefox and paste to preset text box inside slide, the text box will fill with raw code of text . If I directly paste text on slide instead preset text box, right text will be there.

Steps to Reproduce:
1. copy string 维基百科,自由的百科全书
from https://zh.wikipedia.org/wiki/%E6%96%B9%E5%BD%A2%E7%8E%AF%E6%A3%B1%E8%9E%BA in firefox

2. then paste to Impress's preset text box

Actual Results:
Text box will fill with 维基百科,自由的百科全书

Expected Results:
Text box will fill with \u7ef4\u57fa\u767e\u79d1\uff0c\u81ea\u7531\u7684\u767e\u79d1\u5168\u4e66


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 7.2.5.1 / LibreOffice Community
Build ID: 20(Build:1)
CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: kf5 (cairo+wayland)
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Calc: threaded
Comment 1 Ming Hua 2022-02-08 15:13:32 UTC
Some additional information based on the conversation I had with the reporter in the Chinese QQ chat group:

1. The platform is SUSE linux, desktop environment is KDE;

2. Using sddm (SUSE's desktop manager, I assume) to switch to X11 instead of Wayland makes the problem disappear, the VCL in this case is kf5 (cairo+xcb);

3. Staring LibO from command line with "SAL_USE_VCLPLUGIN=gen" environment variable also makes the problem disappear.
Comment 2 Michael Weghorn 2022-02-17 06:49:30 UTC
(In reply to Yuejian MO from comment #0)
> Text box will fill with
> \u7ef4\u57fa\u767e\u79d1\uff0c\u81ea\u7531\u7684\u767e\u79d1\u5168\u4e66

I get a slightly different, but also wrong result here. In my case the text
"$(AN,$(B4pI42J!$<+M3E*I42JA4$(AJi" gets pasted in Impress. 

Just pasting the text from Bugzilla shows the same behavior as when pasting from Wikipedia.

It works just fine when pasting into Writer or Calc instead.

Works fine when using the gtk3 VCL plugin (SAL_USE_VCLPLUGIN=gtk3) or forcing the XCB Qt platform plugin to be used (QT_QPA_PLATFORM=xcb, which is basically equivalent to using an X11 session).

For me, this is on Debian testing with LO master, en-GB locale, plasma-desktop 4:5.23.5-1 and most KF5 libraries just upgraded to 5.90.

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 2029fb151855fba2f812403fbb96b0db1965bcf6
CPU threads: 4; OS: Linux 5.16; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 3 Michael Weghorn 2022-04-06 12:31:47 UTC
Pending Gerrit change: https://gerrit.libreoffice.org/c/core/+/132631
Comment 4 Commit Notification 2022-04-07 04:37:31 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5b3227fac58dcbd588e2389e205679cd77842bac

tdf#147285 qt: Prefer "text/plain;charset=utf-8" over "text/plain"

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2022-04-07 05:22:52 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/b60e4b4ba11c726cbbc45f0747d8fc4d3da0ed74

tdf#147285 qt: Prefer "text/plain;charset=utf-8" over "text/plain"

It will be available in 7.3.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Yuejian MO 2022-04-16 09:15:45 UTC
Thank you so much! It works!!! 
Now, both of Writer and Impress get right pasted text.
Comment 7 Michael Weghorn 2022-04-16 15:39:29 UTC
(In reply to Yuejian MO from comment #6)
> Thank you so much! It works!!! 
> Now, both of Writer and Impress get right pasted text.

Thanks for your feedback. Setting to VERIFIED.