Better handling of UTF-8 output