optimize decoding character