We have a web service callout in Salesforce to a third party, that renders illegal content, which means that their web service returns a response that claims to be UTF-8 text, but isn't. When I base64 decode that text on my local pc, I can verify that the text is in fact ISO-8859-1 data.
However, EncodingUtil.base64Decode() crashes on this input, so it is impossible to decode it in Apex and then perform some conversion afterwards.
Is there any other way to handle this besides asking the third party to become compliant? It could be done in Heroku, but if possible, I'd like it to be done directly in Apex.