optmization for character decoding.