Skip to content
Tcl Source Code History Of Ticket 2987075fffffffff
Login

History Of Ticket 2987075fffffffff

Artifacts Associated With Ticket 2987075fffffffff

  1. Ticket change [78e808ab14] (rid 90038) by rkanherkar on 2010-04-14 11:04:32:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. 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”
      }
      
      
    4. foundin initialized to: "final: 8.3.5"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "rkanherkar"
    10. subsystem initialized to: "45. Parsing and Eval"
    11. title initialized to:
      Tcl function ‘string toupper’ is failing to convert non-asci
      
    12. type initialized to: "RFE"
  2. Ticket change [9d676f1025] (rid 96300) by rkanherkar on 2010-04-14 18:07:09:

    1. priority changed to: "7 High"
  3. Ticket change [7a45ff4b9a] (rid 90287) by dkf on 2010-04-14 18:18:34:

    1. icomment:
      
      
      data_type - 360894
      
      Known issue. Requires API changes (correct behaviour depends on locale!) so won't be done in 8.6
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [b3a7c2fa11] (rid 124892) by dkf on 2010-04-14 18:18:35:

    1. assignee changed to: "dkf"
    2. foundin changed to: "None"
    3. priority changed to: "5 Medium"
    4. subsystem changed to: "18. Commands M-Z"
  5. Ticket change [7b5e444747] (rid 90502) by rkanherkar on 2010-04-14 20:25:15:

    1. 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
      
      
      
    2. login: "rkanherkar"
    3. mimetype: "text/plain"
    4. username: "rkanherkar"
  6. Ticket change [44e4c6c39a] (rid 116784) by dkf on 2010-04-15 05:15:18:

    1. 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. :-(
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  7. Ticket change [135c244c63] (rid 124202) by dkf on 2010-04-15 05:15:56:

    1. icomment:
      Hmm, that's three things. Can't count either...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  8. Ticket change [eca16f3948] (rid 103742) by rkanherkar on 2010-04-15 15:01:13:

    1. 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
      
      
      
    2. login: "rkanherkar"
    3. mimetype: "text/plain"
    4. username: "rkanherkar"
  9. Ticket change [b8617adf5e] (rid 128955) by nijtmans on 2011-09-09 15:27:50:

    1. assignee changed to: "nijtmans"
    2. closedate changed to: "2011-09-09T08:27:50"
    3. closer changed to: "nijtmans"
    4. 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.
      
      
    5. login: "nijtmans"
    6. mimetype: "text/plain"
    7. resolution changed to: "Invalid"
    8. status changed to: "Pending"
    9. username: "nijtmans"
  10. Ticket change [a7acbeae23] (rid 98847) by nijtmans on 2011-10-13 21:41:11:

    1. closedate changed to: "2011-10-13T14:41:11"
    2. closer changed to: "nijtmans"
    3. icomment:
      
      
      allow_comments - 1
      
      Assuming everything is fixed now, otherwise please re-open
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "nijtmans"