Overview
| Artifact ID: | bf8108a37e3ff8c053b928aed1b979ad82b39b12 |
|---|---|
| Ticket: | 539417ffffffffffffffffffffffffffffffffff
backslash causes scan to alter behavior |
| User & Date: | blacksqr on 2002-04-04 19:45:32 |
Changes
- assignee changed to: "nijtmans"
- cmimetype changed to: "text/plain"
- comment changed to:
The command: % scan - %c produces a different output than % scan \- %c where "-" originated as hex 96 in cp1252. Details: I have a file called longdash.txt on my Windows machine which contains a single character, hex 96, which is a long dash in the default system encoding cp1252. I read this file into a variable $longdash. I try % puts $longdash - ...as expected. Now I copy and paste the output character to get the next command: % scan - %c 8211 This is fine, tcl translated the character into its preferred encoding when the file was read. Now I try % scan \- %c 255 Huh? This behavior prevents writing of generalized functions that accept a wide range of characters, since it is desirable to escape out some characters when feeding them to the scan command. Characters with encodings higher than 255 have to be treated as a special case. A backslash should be a guarantee of safety, not a data munger. Steve Huntley [email protected]
- foundin changed to: "obsolete: 8.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "blacksqr"
- subsystem changed to: "44. UTF-8 Strings"
- title changed to: "backslash causes scan to alter behavior"
- type changed to: "Bug"