From: SourceForge.net <no...@so...> - 2008-07-01 19:37:22
|
Patches item #1986818, was opened at 2008-06-06 12:51 Message generated for change (Comment added) made by jenglish You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312997&aid=1986818&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 67. Unix Window Operations Group: None Status: Closed Resolution: Accepted Priority: 5 Private: No Submitted By: Joe English (jenglish) >Assigned to: Joe English (jenglish) Summary: tkUnixKey.c: Use Xutf8LookupString if available Initial Comment: Attached patch modifies tkUnixKey.c to use Xutf8LookupString() instead of XmbLookupString() if the former is available. This should solve problems (like #1908443) where Xlib's idea of the system encoding does not match Tcl's. Also fixes another bug whereby the results of XLookupString were being converted using the system encoding -- this is incorrect, XLookupString is documented to return ISO Latin 1 characters. (GPS, could you take a look?) ---------------------------------------------------------------------- >Comment By: Joe English (jenglish) Date: 2008-07-01 12:37 Message: Logged In: YES user_id=68433 Originator: YES > Please commit to core-8-4-branch if possible. Just checked -- patch does not apply, as it depends on earlier changes (2008-03-26, #1919791) that were not backported to 8.4 either. (And *that* patch wasn't backported because it depends on still earlier cleanup work in tkUnixEvent.c ...) Leaving closed. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2008-06-16 09:19 Message: Logged In: YES user_id=80530 Originator: NO Please commit to core-8-4-branch if possible. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2008-06-10 17:42 Message: Logged In: YES user_id=68433 Originator: YES Patch committed (CVS HEAD and core-8-5-branch. Possibly also applicable to core-8-4-branch.) ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2008-06-08 10:13 Message: Logged In: YES user_id=68433 Originator: YES @flatworm -- no, this patch will probably not fix #1967075. This patch addresses the case where X and Tcl disagree about the system encoding; the symptoms in #1967075 look like Xlib does not support the selected locale at all. ---------------------------------------------------------------------- Comment By: Konstantin Khomoutov (flatworm) Date: 2008-06-07 16:01 Message: Logged In: YES user_id=1350198 Originator: NO Tried 8.6a0 (CVS HEAD as of today) with this patch applied to test #1967075 -- unfortunately, this does not fixes the mentioned "broken locale" bug. ---------------------------------------------------------------------- Comment By: George Peter Staplin (georgeps) Date: 2008-06-07 09:06 Message: Logged In: YES user_id=585068 Originator: NO The Status status; will have an uninitialized random value if !ic->core.im, because Xutf8LookupString doesn't set status when it returns XLookupNone (via return) in the !ic->core.im path. I think it should be something more like: Status status = XLookupNone; so that the code doesn't fall into a branch it shouldn't, because of a random value in the uninitialized status. I chose XLookupNone for status, because none of the other branch tests use that. The code should still work as is though anyway with the uninitialized value even in the !ic->core.im path, but it might result in a Tcl_DString with a length of 1, and a garbage character. It still feels like it might be a bug in Xutf8LookupString. I don't know why it's returning XLookupNone for a length, when XLookupNone is defined with a value of 1. It's also rather confusing that it doesn't do something like: *statusPtr = XLookupNone; instead in a case like this, and return 0. Perhaps that's what the author(s) of Xutf8LookupString should have done. The patch looks good after that change I think. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2008-06-06 18:30 Message: Logged In: YES user_id=68433 Originator: YES Revised patch: reworked XBufferOverflow logic. First version was too clever, and will lead to an infinite loop if Xutf8LookupString() fails to work as expected (see also http://paste.tclers.tk/966). File Added: tk-unixkey-getstring-2.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312997&aid=1986818&group_id=12997 |