New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing MIME encoding related tests #3

Merged
merged 1 commit into from Mar 13, 2017

Conversation

Projects
None yet
2 participants
@kyzn
Contributor

kyzn commented Mar 12, 2017

Hi Maros! Thanks again for maintaining this great module. Here's another PR, this time for a failing test in 07_builder_integration.t

TO header:

This is the name: nice üft-8 nämé
And this is what we are expecting as MIME header: =?UTF-8?B?bmljZSDDg8K8ZnQtOCBuw4PCpG3Dg8Kp?=
Which is Base64 encoded UTF-8 encoded word bmljZSDDg8K8ZnQtOCBuw4PCpG3Dg8Kp
If we try to decode it, it comes as: nice üft-8 nämé..
Which was happening because there was no use utf8 at the test file. I added that and updated the case.

CC header:

This was what was reported in RT 118885, and I was able to produce the error:

got:
=?UTF-8?B?dmVyeSBsb25nIG5hbWUgdGhhdCBleGNlZWRzIHRoZSA3NSBjaGFyYWN0ZXIg?= =?UTF-8?B?bGltaXQgb2YgYW4gZW5jb2RlZCB3b3JkIMODwrxmdC04IG7Dg8KkbcODwqk=?=

expected:
=?UTF-8?B?dmVyeSBsb25nIG5hbWUgdGhhdCBleGNlZWRzIHRoZSA3NSBjaGFyYWN0ZXIgbGk=?= =?UTF-8?B?bWl0IG9mIGFuIGVuY29kZWQgd29yZCDDg8K8ZnQtOCBuw4PCpG3Dg8Kp?=

After adding use utf8;, it became:

got
=?UTF-8?B?dmVyeSBsb25nIG5hbWUgdGhhdCBleGNlZWRzIHRoZSA3NSBjaGFyYWN0ZXIg?=
=?UTF-8?B?bGltaXQgb2YgYW4gZW5jb2RlZCB3b3JkIMO8ZnQtOCBuw6Rtw6k=?=

Which is two UTF-8 Base64 encoded words dmVyeSBsb25nIG5hbWUgdGhhdCBleGNlZWRzIHRoZSA3NSBjaGFyYWN0ZXIgbGltaXQgb2YgYW4gZW5jb2RlZCB3b3JkIMO8ZnQtOCBuw6Rtw6k=
And it actually decodes back to what we want: very long name that exceeds the 75 character limit of an encoded word üft-8 nämé. So I updated this test as well.

I also went ahead and replaced is with a like, giving a little more liberty to spaces we can have. RFC2047 (end of page 12) states that spaces between multiple encoded words are ignored, so this might be helpful if there is an update to Encode that adds/removes spaces.

Let me know if there's anything you want me to update.
Thanks!

#cpan-prc

@maros maros self-assigned this Mar 13, 2017

@maros maros merged commit b6d4cff into maros:master Mar 13, 2017

@maros

This comment has been minimized.

Show comment
Hide comment
@maros

maros Mar 13, 2017

Owner

Thank you for your pull-request

Owner

maros commented Mar 13, 2017

Thank you for your pull-request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment