Change API to return the error's content in expected encoding
Change API to return the error's content in expected encoding

Change to set the encoding to the response body before setting the
contents of the error so that those are correctly encoded.
Fix #1910 - API does not return content in the expected encoding, on
errors

NVolcz/zaproxy,JordanGS/zaproxy,UjuE/zaproxy,JordanGS/zaproxy,NVolcz/zaproxy,thamizarasu/zaproxy,tjackiw/zaproxy,rajiv65/zaproxy,thamizarasu/zaproxy,rajiv65/zaproxy,JordanGS/zaproxy,meitar/zaproxy,rajiv65/zaproxy,pdehaan/zaproxy,zaproxy/zaproxy,kingthorin/zaproxy,JordanGS/zaproxy,pdehaan/zaproxy,gmaran23/zaproxy,JordanGS/zaproxy,Ali-Razmjoo/zaproxy,zaproxy/zaproxy,JordanGS/zaproxy,zapbot/zaproxy,meitar/zaproxy,rajiv65/zaproxy,lightsey/zaproxy,thc202/zaproxy,meitar/zaproxy,mustafa421/zaproxy,zapbot/zaproxy,kingthorin/zaproxy,lightsey/zaproxy,pdehaan/zaproxy,thc202/zaproxy,pdehaan/zaproxy,rajiv65/zaproxy,thc202/zaproxy,thc202/zaproxy,NVolcz/zaproxy,thamizarasu/zaproxy,gmaran23/zaproxy,Harinus/zaproxy,kingthorin/zaproxy,meitar/zaproxy,psiinon/zaproxy,thamizarasu/zaproxy,Harinus/zaproxy,mustafa421/zaproxy,zapbot/zaproxy,zapbot/zaproxy,JordanGS/zaproxy,Ali-Razmjoo/zaproxy,lightsey/zaproxy,gsavastano/zaproxy,thc202/zaproxy,gsavastano/zaproxy,Ali-Razmjoo/zaproxy,gsavastano/zaproxy,UjuE/zaproxy,zaproxy/zaproxy,thamizarasu/zaproxy,tjackiw/zaproxy,NVolcz/zaproxy,lightsey/zaproxy,UjuE/zaproxy,meitar/zaproxy,mustafa421/zaproxy,lightsey/zaproxy,UjuE/zaproxy,psiinon/zaproxy,thamizarasu/zaproxy,kingthorin/zaproxy,meitar/zaproxy,Harinus/zaproxy,meitar/zaproxy,UjuE/zaproxy,tjackiw/zaproxy,kingthorin/zaproxy,Harinus/zaproxy,gsavastano/zaproxy,tjackiw/zaproxy,Ali-Razmjoo/zaproxy,tjackiw/zaproxy,gsavastano/zaproxy,zaproxy/zaproxy,Ali-Razmjoo/zaproxy,psiinon/zaproxy,thc202/zaproxy,Ali-Razmjoo/zaproxy,zaproxy/zaproxy,pdehaan/zaproxy,psiinon/zaproxy,gmaran23/zaproxy,psiinon/zaproxy,rajiv65/zaproxy,psiinon/zaproxy,NVolcz/zaproxy,kingthorin/zaproxy,rajiv65/zaproxy,gmaran23/zaproxy,thamizarasu/zaproxy,NVolcz/zaproxy,lightsey/zaproxy,gsavastano/zaproxy,psiinon/zaproxy,zapbot/zaproxy,UjuE/zaproxy,Ali-Razmjoo/zaproxy,gmaran23/zaproxy,thc202/zaproxy,mustafa421/zaproxy,meitar/zaproxy,zapbot/zaproxy,Harinus/zaproxy,UjuE/zaproxy,mustafa421/zaproxy,gsavastano/zaproxy,lightsey/zaproxy,NVolcz/zaproxy,pdehaan/zaproxy,tjackiw/zaproxy,gmaran23/zaproxy,zaproxy/zaproxy,mustafa421/zaproxy,pdehaan/zaproxy,gmaran23/zaproxy,Harinus/zaproxy,tjackiw/zaproxy,Harinus/zaproxy,kingthorin/zaproxy,mustafa421/zaproxy,zapbot/zaproxy,zaproxy/zaproxy