Overview
Artifact ID: | ac313facd875225ce785e500ee683cfb58ec56f3 |
---|---|
Ticket: | 0e92c404f19ede5b2eb06e6db27647d3138cc56f
Side effect on string range command (from encoding and format commands) |
User & Date: | anonymous 2014-04-30 16:54:49 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
Hi all, I found one very confusing behavior in tcl. set x "\u5317\u4eac" # Beijing in Chinese set y $x puts "x: '$x' -> '[string range $x 0 100]''" puts "y: '$y'" encoding convertfrom "iso8859-1" $y puts "y: '$y'" # format "%s" $y puts "x: '$x' -> '[string range $x 0 100]'" output: x: '北京' -> '北京'' y: '北京' y: '北京' x: '北京' -> '¬' if we uncomment second to last line above output is ok: x: '北京' -> '北京'' y: '北京' y: '北京' x: '北京' -> '北京' encoding and format commands have side effects on string range command (In the second example they negate each other producing good result). Pay attention that neither x nor y were manipulated in any way. However string range command seems to be affected. I use tcl 8.5. Thanks, Nikola
- foundin changed to: "tcl 8.5"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "6b82a19e85309b70487c05b681a5f63a1a1d64bd"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "16. Commands A-H"
- title changed to:
Side effect on string range command (from encoding and format commands)
- type changed to: "Bug"