GNOME Bugzilla – Bug 344496
CRLF converting via Clipboard
Last modified: 2006-06-11 19:47:35 UTC
Please describe the problem: If the string which has non-ascii characters is copied, return-codes are not converted correctly. For example, When "Test String From GTK+ (LF)\n" is copied to the clipboard from GTK+ application, Win32 application can get "Test String From GTK+ (LF)\r\n". It's correct. But "Test String From GTK+ (LF)\n\xe5\xb2\xa9\xe6\x9c\xac\xe4\xb8\x80\xe6\xa8\xb9\n" is copied to the clipboard from GTK+ application, Win32 application gets "Test String From GTK+ (LF)\n\xe5\xb2\xa9\xe6\x9c\xac\xe4\xb8\x80\xe6\xa8\xb9\n". LF is not converted to CRLF. It's not correct. I found this problem on GTK+-2.6.10, GTK+-2.8.18 and HEAD. Steps to reproduce: 1.get cbsample.zip and uncompress 2.run cbgtk.exe and cbw32.exe 3.select Edit -> Copy (LF) on cbgtk.exe 4.select Edit -> Paste (Win32) on cbw32.exe 5.Following message is displayed on cbw32.exe's console 0054 0065 0073 0074 0020 0053 0074 0072 0069 006e 0067 0020 0046 0072 006f 006d 0020 0047 0054 004b 002b 0020 0028 004c 0046 0029 000d 000a 6.select Edit -> Copy Japanese (LF) on cbgtk.exe 7.select Edit -> Paste (Win32) on cbw32.exe 8.Following message is displayed on cbw32.exe's console 0054 0065 0073 0074 0020 0053 0074 0072 0069 006e 0067 0020 0046 0072 006f 006d 0020 0047 0054 004b 002b 0020 0028 004c 0046 0029 000a 5ca9 672c 4e00 6a39 000a We can reproduce this problem without my sample programs. 1.input Japanese at GtkTextView 2.copy inputed string 3.paste on notepad.exe Actual results: Please watch screenshot. Expected results: If LF is copied from GTK+, LF should be always converted to CRLF on Windows. Does this happen every time? Other information:
Created attachment 67086 [details] test programs (source code and Win32 binary)
Created attachment 67087 [details] screenshot (GTK+ application and notepad)
Thanks. Embarrassing bug indeed, luckily trivial to fix. Fixed in HEAD and gtk-2-8. 2006-06-11 Tor Lillqvist <tml@novell.com> * gdk/win32/gdkproperty-win32.c (gdk_property_change): Convert \n to \r\n also when storing CF_UNICODETEXT (UTF-16) in the Clipboard. (#344496)