sendgrid-perl
sendgrid-perl copied to clipboard
UTF8 encoding should happen after URI encoding, not before
My file attachments are corrupt because the binary data is first UTF8 encoded then URI escaped.
As an example, this means a single byte 0xE4 becomes 0xC3A4 (2 bytes), before URI escaping as %C3%A4. It should instead simply be escaped as %E4 then UTF-8 encoded for transmission.
I have fixed my copy of Email/SendGrid/Transport/REST.pm as a proof of concept but need more testing before adding a PR. I have attached a single byte file that triggers the bug.