use utf8; use open OUT => ':utf8'; use DBI; my $dbh = DBI->connect("DBI:mysql:database=mybase;host=localhost;port=3306", "login", "pass"); #$dbh->do('SET CHARACTER SET utf8'); open TST, '>utftest1.txt'; binmode TST; print TST "русский"; $test = $dbh->selectrow_array("SELECT 'русский'"); open TST, '>utftest2.txt'; binmode TST; print TST $test;