Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 12825e89831ed4c05695852e9c58c6be56d99afc63304c22de36579cccc72ded
Ticket: d15847d7b61a0686ec60463987c2f9f77482fee0
lsort and the null character
User & Date: pooryorick on 2020-08-01 07:59:22
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    The output of the following script is <code>127 0 128</code> when it should be
    <code>0 127 128</code>:
    
    <code><verbatim>
    set list [list \x80 \x7f \x00]
    set sorted {}
    foreach item [lsort $list] {
    	scan $item %c ord
    	lappend sorted $ord
    }
    puts $sorted
    </verbatim></code>
    
    
    Furthermore, with the <code>-dictionary</code> argument, the output is <code>0
    127 128</code>, as expected:
    
    
    <code><verbatim>
    set list [list \x80 \x7f \x00]
    set sorted {}
    foreach item [lsort -dictionary $list] {
    	scan $item %c ord
    	lappend sorted $ord
    }
    puts $sorted
    </verbatim></code>
    
  5. foundin changed to: "core-8-6-branch"
  6. is_private changed to: "0"
  7. login: "pooryorick"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "pooryorick"
  13. subsystem changed to: "17. Commands I-L"
  14. title changed to: "lsort and the null character"
  15. type changed to: "Bug"