Re-encode latex output to utf8

This made the task importer crash if the output contained special
characters.