Artifacts Associated With Ticket 1402763fffffffff
Ticket change [6f1a2399b6] (rid 100255) by nobody on 2006-01-11 11:09:05:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I consider the following a bug (in version 8.4.11) set fd [open [select_file]] # Although irrelevant, in the actual test case the file selected is a pdf file. fconfigure $fd -encoding binary -translation binary set inp [read $fd] # Here the type (and internal representation) of 'inp' is 'bytearray' as it indeed should be. regexp -- "stream\x0d\x0a(.+?)\x0d\endstream" $inp x frag # Now the Tcl_Obj record that 'inp' refers to is the same as above but the type now is # 'string' and the value of both the 'bytes' and the 'internalRep' pointer is different from # its previous value. The string the latter points to seems to be in UCS-16 form. # I did not check whether the string value had been changed. If not why was it necessary to copy? Joe Németh (NJG on wiki.tcl.tk)
- foundin initialized to: "obsolete: 8.4.12"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "12. ByteArray Object"
- title initialized to:
bytearray object converted to string on searched by regexp
- type initialized to: "Bug"
Ticket change [3954205754] (rid 112370) by dkf on 2006-01-11 18:43:49:
- icomment:
Logged In: YES user_id=79902 Quite apart from the fact that you shouldn't be relying on the internal rep of objects in the first place, it is still reasonable to expect that REs would be able to use a bytearray object without conversion (after all, all they really need is constant time indexing).
- login: "dkf"
- mimetype: "text/plain"
- subsystem changed to: "43. Regexp"
- username: "dkf"
- icomment:
Ticket change [8bdba371af] (rid 127648) by hobbs on 2006-01-12 00:31:53:
- icomment:
Logged In: YES user_id=72656 Regardless of what might be possible, this is 100% the expected behavior. The RE engine currently operates on unicode strings. It doesn't take bytearrays, it doesn't take utf-8 strings - it wants unicode strings.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Pending"
- username: "hobbs"
- icomment:
Ticket change [92a6aa7587] (rid 120804) by hobbs on 2006-01-12 00:31:54:
- closedate changed to: "2006-01-11T17:31:54"
- closer changed to: "hobbs"
Ticket change [2238b27bc2] (rid 130706) by dkf on 2006-01-12 04:43:49:
- closedate changed to: "2006-01-11T21:43:49"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 Further review indicates that converting the RE engine core to take either unicode arrays or bytecode arrays is "impractical" (i.e. lots of work) since the base token size is a rather deeply hard-coded concept. Given that I (and Jeff too) have no intention of introducing optimizations in this area, this is a definite Wont Fix. (We have never guaranteed preservation of internal reps anyway!)
- login: "dkf"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "dkf"