Calculate length for unicode data