Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2e2caf0225396f8f2e893be85df77048f05dfd566ef0932b67328f216bd0c2ba
Ticket: 9f9c828fde97a4c8a7a528dec3482ecce0838419
trim issue with chinese characters
User & Date: anonymous on 2024-11-06 10:00:15
Changes

  1. icomment:
    Hi sorry for the missing info:
    
    Red Hat Enterprise Linux release 8.5 (Ootpa)
    
    echo 'puts $tcl_version;exit 0' | tclsh
    8.6
    
    It looks it is an issue with TCL using iso8859-1 (default encoding for TCL8.6)
    
    
    set comment "测试包装"
    set comment [encoding convertto utf-8 $comment]
    
    
    puts [binary encode hex $comment]
    
    puts $comment
    set comment [string trim $comment]
    puts [binary encode hex $comment]
    
    puts $comment
    
    
    without [encoding convertto utf-8 $comment] the string representation will not be UTF-8 on command line
    
    But running under Apache as CGI it is using UTF-8 as default, causing this issue.
    
  2. login: "anonymous"
  3. mimetype: "text/plain"