lsort and the null character
Closed / Duplicated15847d7b61a0686ec60463987c2f9f77482fee0Created 6 years agoUpdated 6 years ago
Descriptionwiki2020-08-01 07:59:22
The output of the following script is
127 0 128 when it should be
0 127 128:
set list [list \x80 \x7f \x00]
set sorted {}
foreach item [lsort $list] {
scan $item %c ord
lappend sorted $ord
}
puts $sorted
Furthermore, with the -dictionary argument, the output is 0
127 128, as expected:
set list [list \x80 \x7f \x00]
set sorted {}
foreach item [lsort -dictionary $list] {
scan $item %c ord
lappend sorted $ord
}
puts $sorted
pooryorickwiki2020-08-11 14:05:02
Duplicate of [8e1e31eac0fd6b6c].
Log in (anonymous is fine) to add a comment.