Fix #682: UTF-8 special characters in exception messages get garbled in exception output