half fix for UTF-16 length handling