Remove code_length and use char_length function instead

review10341002