added function to convert char encoding