fix unicode crashes