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 574789 - [PATCH] getwindowlist (and others?) don't handle utf8 well
[PATCH] getwindowlist (and others?) don't handle utf8 well
Status: RESOLVED FIXED
Product: LDTP
Classification: Other
Component: ldtp
unspecified
Other Linux
: Normal normal
: ---
Assigned To: LDTP maintainers
LDTP Development Mailing List
Depends on:
Blocks:
 
 
Reported: 2009-03-10 17:13 UTC by Michael Terry
Modified: 2009-03-10 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use strlen, not g_utf8_strlen (3.41 KB, patch)
2009-03-10 17:14 UTC, Michael Terry
none Details | Review

Description Michael Terry 2009-03-10 17:13:37 UTC
I was playing with getwindowlist with utf-8 window titles.  I ran into an issue when the ldtp server responded with a <FILE> element.  The file specified was short a few characters, making it invalid XML.

To test this, open, say, http://en.wikipedia.org/wiki/D%C3%A9j%C3%A0_vu in a browser.  Then run a simple python script that runs ldtp.getwindowlist().

I believe that the server provides a <FILE> element only if the list is big (looking at the code, over 512 bytes?).  So you may need lots of windows open.

I have a patch, but I haven't tested it yet.  I will try tonight, but wanted to put it up while I had time.  The problem is that client-handler.c seems to use g_utf8_strlen when it should use strlen.  I've attached a patch that is more uniform about its use of strlen.
Comment 1 Michael Terry 2009-03-10 17:14:02 UTC
Created attachment 130416 [details] [review]
Use strlen, not g_utf8_strlen
Comment 2 Nagappan Alagappan 2009-03-10 18:02:51 UTC
Thanks for the patch, its part of LDTP 1.5.1 release :)
Comment 3 Michael Terry 2009-03-10 18:38:52 UTC
That was fast!  OK, but like I said, I did not test it yet.  I trust you saw that it was the right thing to do and/or tested it?
Comment 4 Nagappan Alagappan 2009-03-10 18:40:05 UTC
Yes, I verified the basic test and it is working fine :)

Thanks