Fix UTF-8 handling of log files