Bug 165238 - Copy-pasting non-latin from Firefox/Thunderbird to LibreOffice resulting in \u0000 notation (kf6-only)
Summary: Copy-pasting non-latin from Firefox/Thunderbird to LibreOffice resulting in \...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:25.8.0 target:25.2.1
Keywords: notBibisectable, regression
: 165222 (view as bug list)
Depends on:
Blocks: Wayland Qt6
  Show dependency treegraph
 
Reported: 2025-02-13 15:27 UTC by iam
Modified: 2025-02-19 05:13 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of an issue (193.82 KB, image/png)
2025-02-13 15:27 UTC, iam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description iam 2025-02-13 15:27:27 UTC
Description:
Copy-pasting non-latin from Firefox/Thunderbird to LibreOffice resulting in \u0000 notation.
This happens only on Linux+Wayland (not X11), started to happen after updating Fedora 41 to KDE Plasma 6.3.

Steps to Reproduce:
1. Open any webpage with Cyrillic, Greek, any non-latin text in Firefox (or in Thunderbird)
2. Select and copy the text to clipboard
3. Open Libreoffice Writer, press ctrl+alt+shift+v to paste without formatting. If it's an unformatted text (copied from the text field, address bar, etc, not from the html body itself) regular ctrl+v is sufficient.

Actual Results:
Instead of pasting the symbols, \u0000 unicode notation of the symbols are pasted into Libreoffice document.

Expected Results:
Cyrillic/Greek/etc symbols are pasted


Reproducible: Always


User Profile Reset: No

Additional Info:
Libreoffice:

Version: 24.8.4.2 (X86_64)
Build ID: 480(Build:2)
CPU threads: 16; OS: Linux 6.12; UI render: default; VCL: kf6 (cairo+wayland)
Locale: ru-RU (en_US.UTF-8); UI: en-US
Calc: threaded

System:

Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Kernel Version: 6.12.11-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × 13th Gen Intel® Core™ i5-1340P
Memory: 30,9 GiB of RAM
Graphics Processor: Intel® Iris® Xe Graphics
Manufacturer: Intel(R) Client Systems
Product Name: NUC13ANKi5
System Version: N11211-203

Cross-bug in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1948039
Comment 1 iam 2025-02-13 15:27:51 UTC
Created attachment 199189 [details]
Screenshot of an issue

Check the screenshot attached.
Comment 2 Xisco Faulí 2025-02-13 15:59:40 UTC
*** Bug 165222 has been marked as a duplicate of this bug. ***
Comment 3 Xisco Faulí 2025-02-13 16:00:42 UTC
Hi Michael, Ilmari,
According to this report and its duplicate, the issue seems to happen with kf6
Do you reproduce it on your end ?
Comment 4 Xisco Faulí 2025-02-13 16:03:23 UTC
not reproduced with Firefox 128 and

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7da1497aa462e2b719aa9b308a749caf7b9a19b1
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

What happens if you paste the content into another text editor ?
Comment 5 iam 2025-02-13 16:04:08 UTC
According to my dnf update log, I've only updated KDE Plasma from 6.2 to 6.3. Libreoffice has not been updated, it's 24.8.4.2.
Comment 6 iam 2025-02-13 16:07:16 UTC
>What happens if you paste the content into another text editor ?

Everything works fine. I don't have much other text editors with rich text support though, but I've tested on CherryTree, and it works as expected.

Also Libreoffice works fine in X11 session. This issue is only in Wayland session.
Comment 7 iam 2025-02-13 16:08:07 UTC
This also applies when copying e.g. email address with the name in Thunderbird, or email subject, all of which are not rich text, and pasting it into Writer/Calc.
Comment 8 iam 2025-02-13 16:10:49 UTC
Works fine when copying from Chromium.
Comment 9 Buovjaga 2025-02-13 16:50:48 UTC
Repro, only with kf6, not with kf5.

Sadly we can't bibisect as the repos are not built with kf6.

Arch Linux 64-bit
Version: 25.2.0.3 (X86_64) / LibreOffice Community
Build ID: 520(Build:3)
CPU threads: 8; OS: Linux 6.13; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
25.2.0-1
Calc: threaded

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 449aca5c02c9a927f44b3c6cae99248903fb492c
CPU threads: 8; OS: Linux 6.13; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Comment 11 Michael Weghorn 2025-02-14 09:03:05 UTC
(In reply to Buovjaga from comment #10)
> You can use this as source:
> https://el.wikipedia.org/wiki/
> %CE%9A%CF%85%CF%81%CE%B9%CE%BB%CE%BB%CE%B9%CE%BA%CF%8C_%CE%B1%CE%BB%CF%86%CE%
> AC%CE%B2%CE%B7%CF%84%CE%BF

(In reply to Buovjaga from comment #9)
> Repro, only with kf6, not with kf5.

Copying the title ("Κυριλλικό αλφάβητο") and pasting into Writer works fine for me from Firefox 128.7.0esr on Debian testing (with plasma-desktop 4:6.2.5-1) and current master with qt6 (using current Qt development version)

Does pasting into another Qt/KDE application (like Kate) work for you?

> This happens only on Linux+Wayland (not X11), started to happen after
> updating Fedora 41 to KDE Plasma 6.3.

That might be related to some KDE component. I remember seeing (different) issues with copy-paste from Firefox/Thunderbird in a Plasma development version on Wayland earlier. The issue went away at some point, was presumably fixed somewhere in KDE components. But that might have been a different issue.

Does setting environment variable MOZ_ENABLE_WAYLAND=1 before starting Firefox/Thunderbird make any difference? (It forces them to run as native Wayland clients, while they run on XWayland by default.)

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 41ab24cecd6ad74312843f113d2faa13259cdb7d
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: qt6 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 12 Michael Weghorn 2025-02-14 09:13:50 UTC
(In reply to Michael Weghorn from comment #11)
> Copying the title ("Κυριλλικό αλφάβητο") and pasting into Writer works fine
> for me from Firefox 128.7.0esr on Debian testing (with plasma-desktop
> 4:6.2.5-1) and current master with qt6 (using current Qt development version)

Actually, it doesn't. I can reproduce now. (I initially accidently pasted as is, not as plain text. The latter fails for me, too.)

Answering my own questions.
 
> Does pasting into another Qt/KDE application (like Kate) work for you?

Yes, that works, and copying from there, then pasting into Writer also works.

> Does setting environment variable MOZ_ENABLE_WAYLAND=1 before starting
> Firefox/Thunderbird make any difference?

No, behavior stays the same.
Comment 13 Michael Weghorn 2025-02-14 09:56:07 UTC
Pending fix: https://gerrit.libreoffice.org/c/core/+/181660
Comment 14 Commit Notification 2025-02-14 15:43:31 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

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

tdf#165238 qt: Rely on Qt for "text/plain" and UTF-8 clipboard text

It will be available in 25.8.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 15 Michael Weghorn 2025-02-14 15:44:37 UTC
Fixed in master now. Backport for 25-2 pending in Gerrit:
https://gerrit.libreoffice.org/c/core/+/181672
Comment 16 Buovjaga 2025-02-14 15:46:09 UTC
Verified, thanks
Comment 17 iam 2025-02-15 08:11:35 UTC
Works as intended, thanks!
Fedora has already provided a patched packages: https://bugzilla.redhat.com/show_bug.cgi?id=2345783
Comment 18 ardv 2025-02-16 15:49:37 UTC
i think this should be fixed in the main current build: 25.2 and not just in the nightly builds. 
users need to wait 6 months for the main version to have this issue fixed?
Comment 19 Buovjaga 2025-02-16 18:22:51 UTC
(In reply to ardv from comment #18)
> i think this should be fixed in the main current build: 25.2 and not just in
> the nightly builds. 
> users need to wait 6 months for the main version to have this issue fixed?

You seem to have ignored comment 15 completely.
Comment 20 Commit Notification 2025-02-17 16:33:51 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/37c4ed18228526d2a7e653d119d98ee9ba7c535c

tdf#165238 qt: Rely on Qt for "text/plain" and UTF-8 clipboard text

It will be available in 25.2.2.

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 21 Commit Notification 2025-02-18 11:11:23 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-25-2-1":

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

tdf#165238 qt: Rely on Qt for "text/plain" and UTF-8 clipboard text

It will be available in 25.2.1.

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.