Fix serializing multibyte character length issue.