Overview
| Artifact ID: | d4b1dc9a004d25c117e03355741be096ec3b8514 |
|---|---|
| Ticket: | 1402782fffffffffffffffffffffffffffffffff
bytearray object converted to string on searched by regexp |
| User & Date: | nobody on 2006-01-11 11:29:22 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed 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 changed to: "obsolete: 8.4.12"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "12. ByteArray Object"
- title changed to:
bytearray object converted to string on searched by regexp
- type changed to: "Bug"