ï»¿set foo æå½

set bar [binary format a* $foo]

if { $foo != $bar } {
    puts "foo != bar"
}