in and length checks for codecvt_utf16