GNOME Bugzilla – Bug 706657
win32: clipboard should not strip \r
Last modified: 2018-05-02 15:47:24 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 ?
Btw, I was refering to wikipedia page about line endings and utf8: http://en.wikipedia.org/wiki/Newline
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.
It looks like this is still relevant. Low priority though, (spice-gtk is doing some line-ending conversion back).
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.
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
-- 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.