Set encoding in print_text.