Added support of different encodings