Taking Encoding into consideration when decoding the input stream.