Posted to tcl by evilotto at Thu Oct 11 17:27:17 GMT 2012view raw

  1. set filename "hello\xa0world"
  2.  
  3. encoding system iso8859-1
  4. set f [open $filename w]
  5. puts $f ok
  6. close $f
  7.  
  8. encoding system utf-8
  9.  
  10. set files [glob "hell*"]
  11. set fn [lindex $files 0]
  12. set f [open $fn r]
  13. puts [read $f]
  14. close $f
  15.