fix tf.txt generation

add support of non UTF-8 encoding characters
add tf converter