Artifacts Associated With Ticket 2987075fffffffff
Ticket change [78e808ab14] (rid 90038) by rkanherkar on 2010-04-14 11:04:32:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Problem: Tcl function ‘string toupper’ is failing to convert non-ascii characters from lower case to upper case ================= Tcl Version (Group field) ================= 8.3.5 OS Platform and Version ================= AIX 5.3 , Solaris 10, Linux (RHEL5.3, 5.4) Problem Behavior ================= We are using TCL library function ‘Tcl_EvalFile’ to execute the .tcl script. Two arguments interp, filename are passed for function ‘Tcl_EvalFile’. After successful execution everything works fine but the statement ‘string toupper’ is failing to convert non-ascii characters to uppercase. Tcl code file exit9.tcl is pasted in section Concise Code Sample After successful execution of exit9.tcl script the exit9.log file contains following output which is unexpected Exit 9 called Insert Person Person = râhuèïøû Upper Person = RâHUèïøû Another interesting observation is that when we try using ‘tclsh’ interpreter on prompt, the statement ‘string toupper’ behaves as expected #> tclsh % string toupper “râhuèïøû” RÂHUÈÏØÛ % exit #> Expected Behavior ================= Using TCL library function ‘Tcl_EvalFile’ the expected output for statement ‘string toupper’ should be RÂHUÈÏØÛ Concise Code Sample (if applicable) ================= set log_file “/appl/ess.version/log/out/exit9.log” if {[catch {set log_file [open $log_file a+]} err]} { puts “Error while opening log file” return } puts $log_file “Exit 9 called” puts $log_file “Insert Person” set USERNAME “râhuèïøû” puts $log_file “Person = $USERNAME” set USER_UPPER [string toupper $USERNAME] puts $log_file “Upper Person = $USER_UPPER” if {[catch {close $log_file} err]} { puts $log_file “Error while writing to log file” } - foundin initialized to: "final: 8.3.5"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "rkanherkar"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to:
Tcl function ‘string toupper’ is failing to convert non-asci
- type initialized to: "RFE"
Ticket change [9d676f1025] (rid 96300) by rkanherkar on 2010-04-14 18:07:09:
- priority changed to: "7 High"
Ticket change [7a45ff4b9a] (rid 90287) by dkf on 2010-04-14 18:18:34:
- icomment:
data_type - 360894 Known issue. Requires API changes (correct behaviour depends on locale!) so won't be done in 8.6
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [b3a7c2fa11] (rid 124892) by dkf on 2010-04-14 18:18:35:
- assignee changed to: "dkf"
- foundin changed to: "None"
- priority changed to: "5 Medium"
- subsystem changed to: "18. Commands M-Z"
Ticket change [7b5e444747] (rid 90502) by rkanherkar on 2010-04-14 20:25:15:
- icomment:
Hi Donal, On AIX I tried using locale C, en_US, en_US.8859-15,en_US.ISO8859-1 and EN_US.UTF-8 but I got the unexpected result. We are using TCL version 8.3.5 Can u elaborate the workaround ? do we need to change the TCL version? Regards Rahul
- login: "rkanherkar"
- mimetype: "text/plain"
- username: "rkanherkar"
- icomment:
Ticket change [44e4c6c39a] (rid 116784) by dkf on 2010-04-15 05:15:18:
- icomment:
Oops, misread it slightly. There are two issues here. There are several issues here: 1) 8.3.5 isn't really supported by us any more. 2) Tcl strongly prefers to work with characters, but the underlying C toupper() function is byte-oriented. (And we don't do locale handling right either.) What happens is dependent on the platform too; some get this 99% right and others get nowhere close. This is basically what I was referring to. 3) I've no idea why it might be working at the console but failling from a file on a single platform. :-(
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [135c244c63] (rid 124202) by dkf on 2010-04-15 05:15:56:
- icomment:
Hmm, that's three things. Can't count either...
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [eca16f3948] (rid 103742) by rkanherkar on 2010-04-15 15:01:13:
- icomment:
Hi Donal, Today I tried with Solaris and AIX and Linux platform and along with the TCL version is 8.5.8. But I observed same behaviour which is wrong. As you mentioned this is known ISSUE with TCL, So do u have any defect/bug created for this? If Yes, can you please provide the defect-id ? It will be greate if you provide the defect-id Your help appriciated Regards Rahul
- login: "rkanherkar"
- mimetype: "text/plain"
- username: "rkanherkar"
- icomment:
Ticket change [b8617adf5e] (rid 128955) by nijtmans on 2011-09-09 15:27:50:
- assignee changed to: "nijtmans"
- closedate changed to: "2011-09-09T08:27:50"
- closer changed to: "nijtmans"
- icomment:
The problem here looks like that the function Tcl_FindExecutable() was not called before the interpreter was created. This function is used to set up various encodings. Earler Tcl versions were more critical on that, in later Tcl versions more encodings were built in, so it might work fine already. Still, if you want to be sure that all character encodings work as expected, please call Tcl_FindExecutable() before doing anything else.
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Pending"
- username: "nijtmans"
Ticket change [a7acbeae23] (rid 98847) by nijtmans on 2011-10-13 21:41:11:
- closedate changed to: "2011-10-13T14:41:11"
- closer changed to: "nijtmans"
- icomment:
allow_comments - 1 Assuming everything is fixed now, otherwise please re-open
- login: "nijtmans"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "nijtmans"