Hi all, I've written about this before, but it's come back and I still haven't found what the problem is. Basically, in Perl/Tk if a textbox has a lot of text in it (no idea on the limit yet - all I know is that it has to be a _lot_ of text), and all the text is selected (and therefore copied to the clipboard) the entire perl process is halted, the gui disappears and the error: selection conversion left too many bytes unconverted appears on the command line. This appears to be a tcl panic error (hence the cross-post to comp.lang.tcl as I'm not sure where the problem is) if google is anything to go by. This has become a serious problem - users aren't too happy when a program crashes outright from something as simple as selecting text. Does anyone have any idea how to avoid/fix this problem? I'm using perl v5.8.7 with Perl/Tk 804.027 and wish 8.4 is installed (if that has any bearing). MB
Did you try the Perl/Tk group? This may be specific to Perl/Tk and not Tcl/Tk. Robert
You know, sometimes I don't like the new Google groups as I can't see the headers without showing the "options". Sorry, after posting it was obvious that you had posted to the Perl/Tk group. Robert
"Matthew Braid" <not@invalid.invalid> wrote > > Basically, in Perl/Tk if a textbox has a lot of text in it (no idea on > the limit yet - all I know is that it has to be a _lot_ of text), and > all the text is selected (and therefore copied to the clipboard) the > entire perl process is halted, the gui disappears and the error: > > selection conversion left too many bytes unconverted Never seen that one before. But a little googling reveals this code in TkSelPropProc in tkUnixSelect.c. Here is a snippet of the code. But I'm not an X window or a UTF conversion guy, so I can't tell you what's really going on here. /* * Encode the data using the proper format for each type. */ if ((formatType == XA_STRING) || (dispPtr && formatType==dispPtr->utf8Atom) || (dispPtr && formatType==dispPtr->compoundTextAtom)) { .... much code elided ... /* * Preserve any left-over bytes. */ if (srcLen > TCL_UTF_MAX) { Tcl_Panic("selection conversion left too many bytes unconverted"); } Good luck, Bob -- Bob Techentin techentin.robert@NOSPAMmayo.edu Mayo Foundation (507) 538-5495 200 First St. SW FAX (507) 284-9171 Rochester MN, 55901 USA http://www.mayo.edu/sppdg/
Bob Techentin wrote: > Never seen that one before. But a little googling reveals this code in > TkSelPropProc in tkUnixSelect.c. Here is a snippet of the code. But I'm > not an X window or a UTF conversion guy, so I can't tell you what's really > going on here. [...] > if (srcLen > TCL_UTF_MAX) { > Tcl_Panic("selection conversion left too many bytes unconverted"); > } The code's figured out that something odd is going on, as the external to internal encoding conversion engine left more bytes over than ought to be legal (i.e. more than the maximum number of bytes that a single character may be represented as). That's the immediate cause, but I've not the faintest idea what may be causing that. Donal.