check if response.setEncoding function exist

this function doesn't exist on all clients
conform
Merge pull request #6 from triptec/patch-1

check if response.setEncoding function exist