Bug 8534 - Can't copy Latin-1 strings from client to server
Summary: Can't copy Latin-1 strings from client to server
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Client (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-25 13:59 CET by Adam Halim
Modified: 2025-03-04 13:13 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Adam Halim cendio 2025-02-25 13:59:37 CET
Broken out from bug 8427 comment #9.

Contents stored in the STRING target has to be Latin-1 encoded [1].

It looks like FLTK doesn't validate that contents stored in the STRING target are Latin-1 encoded (it should be responsible for converting UTF-8 <-> Latin-1). This means that applications that put Latin-1 strings into the clipboard on the client side won't be able to get pasted correctly inside the session.

This is probably not a common issue in practice, as most of the world uses UTF8_STRING anyway.

[1] https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html
Comment 1 Pierre Ossman cendio 2025-02-25 14:40:39 CET
It seems not just FLTK suffers from this bug. GTK, Qt5 and Chrome all also have the issue. Qt6 and xterm implement things according to the specification, though.

In the case of GTK, it does indeed seem to be a bug somewhere. I can find code in gdkselection-x11.c that checks if the type is STRING, and if so, converts from latin-1 to UTF-8. For some reason, that code isn't working correctly.

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