fix a bug of encoding in  print to screen