After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706657 - win32: clipboard should not strip \r
win32: clipboard should not strip \r
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: Win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-08-23 12:38 UTC by Marc-Andre Lureau
Modified: 2018-05-02 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marc-Andre Lureau 2013-08-23 12:38:19 UTC
Currently, in gdk/win32/gdkselection-win32.c, text line ending is converted automatically from \r\n to \n for _utf8_string target. However, this is a loss of information: "Unicode was designed to preserve all information when converting a text file from any existing encoding to Unicode and back."

I imagine the reason could be that gtk+ internals handle only correctly \n endings? perhaps we could consider another target on win32, like UTF8_NATIVE_STRING ?
Comment 1 Marc-Andre Lureau 2013-08-23 12:40:17 UTC
Btw, I was refering to wikipedia page about line endings and utf8: http://en.wikipedia.org/wiki/Newline
Comment 2 Matthias Clasen 2018-02-10 05:21:06 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 3 Marc-Andre Lureau 2018-02-10 09:31:08 UTC
It looks like this is still relevant. Low priority though, (spice-gtk is doing some line-ending conversion back).
Comment 4 LRN 2018-02-10 09:46:53 UTC
This will be/should be (i think it already landed in GTK3 HEAD, some parts are still pending for GTK4) fixed in the new clipboard code.
In GTK3 you have to call gtk_clipboard_request_contents() with the gdk atom for "CF_UNICODETEXT" as the clipboard type. In GTK4 you'll have to do something similar (i think it would be something like "application/x.windows.CF_UNICODETEXT", which is not a valid mime/type, but works for our purposes). This will give you the raw UTF-16 data as given by the OS, without any modifications.
Comment 5 Marc-Andre Lureau 2018-02-10 10:56:47 UTC
thanks, I am fine closing if there is a way to do it upstream now. It will be nice if someone could summarize the c&p/dnd changes somewhere (doc/blog whatever) :) thanks
Comment 6 GNOME Infrastructure Team 2018-05-02 15:47:24 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/444.