Overview
| Artifact ID: | 55c70c987c3798a671c30b33f7fab26ee3502cd1 |
|---|---|
| Ticket: | 218100ffffffffffffffffffffffffffffffffff
Tcl_Eval does not treat a command the same as in the console |
| User & Date: | nobody on 2000-10-26 00:53:09 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 1803 Bug Version: 8.1b3 SubmitDate: '1999-04-14' LastModified: '2000-04-03' Severity: SER Status: Closed Submitter: pat ChangedBy: hobbs OS: Windows 95 Machine: X86 FixedDate: '2000-10-25' ClosedDate: '2000-04-03' Name: Di Yu Comments: This is a very bad problem as it makes the compilation of programs containing Chinese words virtually impossible. I don't know why Tcl_Eval think the string is 5-bytes with the third one as Unicode \u04dd, and not 6-bytes as the console treat it. In fact, when I try to compile a program which contains "encoding convertfrom gb2212 ...", the generated executable can hardly do any correct converting. ReproducibleScript: #include <tcl.h> void main(int argc, char **argv) { Tcl_Interp *Interp=Tcl_CreateInterp(); Tcl_Init(Interp); Tcl_Eval(Interp, "set s ÏÂ?Ìâ"); Tcl_Eval(Interp, "for {set i 0} {$i<[string length $s]} {incr i} {set c [string index $s $i]; scan $c \"%c\" code; puts [format \"%x\" $code];}"); Tcl_DeleteInterp(Interp); exit(1); } ObservedBehavior: The program, after compiled to an executable file(under Windows, using VC++5.0), gives the following result when executed: cf c2 4bb cc e2 DesiredBehavior: It should give: cf c2 d2 bb cc e2 just as the same script would give when executed in the wish console. There is slight confusion here, because the console has an implicit encoding phase the that user is ignoring. The user wants to do Tcl_ExternalToUtfDString to have this evaluate correctly, or include some other conversion step at the C level, to make up for the lack of internal recoding that the console does for us. -- 04/03/2000 hobbs - foundin changed to: "obsolete: 8.1b3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "57. zlib"
- title changed to:
Tcl_Eval does not treat a command the same as in the console
- type changed to: "RFE"