> All text is rendered ok, but the problem is that the conversion of > non-latin characters by teTeX into something weird like > "^^de^^d4^^c5^^ce^^c9^^c5" while writing them into file with \write.
I guess that you are using teTeX-2.0, because teTeX-3.0 processes this without any problem. The solution to this problem for teTeX-2.0 is to pass --translate-file=cp8bit, either like this: latex --translate-file=cp8bit foo.tex Or by adding %& --translate-file=cp8bit.tcx to your TeX source (first line) and setting parse_first_line = t in texmf.cnf. Thomas