Implemented Document#inputEncoding

Resolves #4252