Posted to tcl by Bradipo at Fri Sep 02 23:47:19 GMT 2016view raw

  1. % set fd [open qtest.txt]
  2. file5
  3. % fconfigure $fd -encoding unicode
  4. % set data [read $fd]
  5. close $fd
  6. puts "len: [string length $data]"
  7. ?INSERT INTO unit(id, name) VALUES (1, '??????????, ???????');
  8. INSERT INTO unit(id, name) VALUES (2, '??????? ????????? ???? ???????? ????????? ????????, ?²');
  9. % % len: 159
  10. %
  11. set ofd [open import.txt w]
  12. fconfigure $ofd -encoding utf-8
  13. puts $ofd $data
  14. close $ofd
  15. % file5
  16. % % % %