-
Notifications
You must be signed in to change notification settings - Fork 266
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
Keep all bytes of one UTF-8 char on same line (no split) #92
Conversation
AFAIK, Please, also add unittests! |
Is "\r\n" counted in this 76 bytes? |
Each encoded line not longer 75 bytes (76 with first space character). |
@seriyps Do you think the line length issue is resolved? |
@mworrell I guess it is, but still no unittests for this functionality |
@skorobkov can you add your example (with all the €) as an unit test? |
Sorry for delay. |
test/gen_smtp_util_test.erl
Outdated
++ " =?UTF-8?Q?4=20=E2=82=AC=20=E2=82=AC=20=E2=82=AC=20=E2=82=AC=20123=20?=\r\n" | ||
++ " =?UTF-8?Q?=E2=82=AC=20=E2=82=AC=20=E2=82=AC=20=E2=82=AC=20=E2=82=AC=20123?=\r\n" | ||
++ " =?UTF-8?Q?4=E2=82=AC?=", | ||
?assertEqual(mimemail:rfc2047_utf8_encode(UnicodeString), Encoded). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to http://erlang.org/doc/apps/eunit/chapter.html#Assert_macros it's recommended to place 'expected' as a first argument and 'actual result' as 2nd of assertEqual
Looks good |
I also like it. Merging. @skorobkov Thank you! |
mimemail:rfc2047_utf8_encode/1
can splite multibyte UTF-8 character to difrent lines.Example:
Russian word "Информация",
mimemail:rfc2047_utf8_encode/1
converting it into 2 strings=?UTF-8?Q?=D0=98=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D1?=
=?UTF-8?Q?=8F?=
Last character "и" (
=D1=8F
) splitted, and dont show correctly in mail-readers.