token to character convertion function