Fix crash on non-utf-8