fix unicode writes