Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 78e808ab1469a56fe08e48c6e81f1d58068932d6
Ticket: 2987075fffffffffffffffffffffffffffffffff
Tcl function ‘string toupper’ is failing to convert non-asci
User & Date: rkanherkar on 2010-04-14 11:04:32
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed 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 changed to: "final: 8.3.5"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "rkanherkar"
  10. subsystem changed to: "45. Parsing and Eval"
  11. title changed to:
    Tcl function ‘string toupper’ is failing to convert non-asci
    
  12. type changed to: "RFE"