Fix UnicodeDecodeError

Thanks to @dimier.