Added a function for Document.inputEncoding
auto-merge staging into master