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

% set fd [open qtest.txt]
file5
% fconfigure $fd -encoding unicode
% set data [read $fd]
close $fd
puts "len: [string length $data]"
?INSERT INTO unit(id, name) VALUES (1, '??????????, ???????');
INSERT INTO unit(id, name) VALUES (2, '??????? ????????? ???? ???????? ????????? ????????, ?²');
% % len: 159
% 
set ofd [open import.txt w]
fconfigure $ofd -encoding utf-8
puts $ofd $data
close $ofd
% file5
% % % %