Fix multi-byte character strings length detection.