Fixed wrong default encoding being used for HTTP requests and responses (closes #501)