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 344496 - CRLF converting via Clipboard
CRLF converting via Clipboard
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-06-10 17:21 UTC by Kazuki Iwamoto
Modified: 2006-06-11 19:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test programs (source code and Win32 binary) (6.81 KB, application/zip)
2006-06-10 17:23 UTC, Kazuki Iwamoto
Details
screenshot (GTK+ application and notepad) (49.90 KB, image/jpeg)
2006-06-10 17:25 UTC, Kazuki Iwamoto
Details

Description Kazuki Iwamoto 2006-06-10 17:21:17 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:
Comment 1 Kazuki Iwamoto 2006-06-10 17:23:41 UTC
Created attachment 67086 [details]
test programs (source code and Win32 binary)
Comment 2 Kazuki Iwamoto 2006-06-10 17:25:17 UTC
Created attachment 67087 [details]
screenshot (GTK+ application and notepad)
Comment 3 Tor Lillqvist 2006-06-11 19:47:35 UTC
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)