support different input encodings