sendgrid-perl icon indicating copy to clipboard operation
sendgrid-perl copied to clipboard

UTF8 encoding should happen after URI encoding, not before

Open njphillips opened this issue 8 years ago • 0 comments

test-utf8.txt

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.

njphillips avatar Apr 16 '16 01:04 njphillips