In this case the set of characters that may be used in a "Q"-encoded
'encoded-word' is restricted to: <upper and lower case ASCII
letters, decimal digits, "!", "*", "+", "-", "/", "=", and "_"
(underscore, ASCII 95.)>. An 'encoded-word' that appears within a
'phrase' MUST be separated from any adjacent 'word', 'text' or
'special' by 'linear-white-space'.
The "-character is not allowed in an 'encoded-word'.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But I think there is more to do.:
- The encode() function in qpEncoder.cpp has to encode more special characters like '§$%&'.
- The "outputCount" in function getNextChunk() in wordEncode.cpp is wrong for this special characters.
Best Regards,
Achim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think it should encode to ("_" for space)
From: =?us-ascii?Q?=22Achim?= =?utf-8?Q?_Br=C3=A4ndt=22?= <me@vmime.org>
or
From: =?utf-8?Q?=22Achim_Br=C3=A4ndt=22?= <me@vmime.org>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There was a bug in text::createFromString(): whitespaces were simply used as word separator, then ignored. Now, whitespace is added to the previously parsed word.
I am trying to generate mails with vmime. Using the function
vmime::text::newFromString for assigning values with no ascii
characters to headerField, I have observed that the new strings contain
additional white-spaces.
Sample: Input String 'ü e)' . The Output of vmime::text::newFromString
is 'ü e)'. It contains an additional white space. I could reproduce
this behaviour without vmime::text::newFromString too, with following code
The word encoder does not encode all characters:
Subject: =?UTF-8?Q?"=C3=9Cml=C3=A4ute"?=
should be:
Subject: =?UTF-8?Q?=22=C3=9Cml=C3=A4ute=22?=
The RFC (http://tools.ietf.org/html/rfc2047#section-5) says:
In this case the set of characters that may be used in a "Q"-encoded
'encoded-word' is restricted to: <upper and lower case ASCII
letters, decimal digits, "!", "*", "+", "-", "/", "=", and "_"
(underscore, ASCII 95.)>. An 'encoded-word' that appears within a
'phrase' MUST be separated from any adjacent 'word', 'text' or
'special' by 'linear-white-space'.
The "-character is not allowed in an 'encoded-word'.
Hello,
Thank you for your report, I just fixed it.
Here is the patch:
http://www.vmime.org/download/patches/vmime-20101012-rfc2047quot.patch
Regards,
Vincent
Thanks for the fast patch.
But I think there is more to do.:
- The encode() function in qpEncoder.cpp has to encode more special characters like '§$%&'.
- The "outputCount" in function getNextChunk() in wordEncode.cpp is wrong for this special characters.
Best Regards,
Achim
You are right.
I have rewritten RFC-2047 encoding, here is a better patch:
http://www.vmime.org/download/patches/vmime-20101012-rfc2047better.patch
Please let me know whether it works for you.
Regards,
Vincent
Thanks for the fast and better patch.
Best Regards,
Achim
There is an other text encoder problem;
vmime::messageBuilder mb;
mb.setExpeditor(vmime::mailbox(vmime::text("\"Achim Brändt\"", vmime::charsets::UTF_8), "me@vmime.org"));
encodes to:
From: =?us-ascii?Q?=22Achim?= =?utf-8?Q?Br=C3=A4ndt=22?= <me@vmime.org>
and this decodes to:
"AchimBrändt" me@vmime.org
I think it should encode to ("_" for space)
From: =?us-ascii?Q?=22Achim?= =?utf-8?Q?_Br=C3=A4ndt=22?= <me@vmime.org>
or
From: =?utf-8?Q?=22Achim_Br=C3=A4ndt=22?= <me@vmime.org>
Hello,
There was a bug in text::createFromString(): whitespaces were simply used as word separator, then ignored. Now, whitespace is added to the previously parsed word.
Try with this patch:
http://www.vmime.org/download/patches/vmime-20101012-word-whitespace.patch
Vincent
Thanks,
Encoding works for me now.
Best Regards
Achim
Hello,
I am trying to generate mails with vmime. Using the function
vmime::text::newFromString for assigning values with no ascii
characters to headerField, I have observed that the new strings contain
additional white-spaces.
Sample: Input String 'ü e)' . The Output of vmime::text::newFromString
is 'ü e)'. It contains an additional white space. I could reproduce
this behaviour without vmime::text::newFromString too, with following code
I get the string (value of gen_str):
In my opinion there is an additional white space (which is too much)
Using the method decodeAndUnfold one gets the converted string
Resume:
Input string
Converted string
This happens in following constellations:
"non ascii character" white-space ascii-character !"$%&/()=?,;.:<>|@
I would appreciate, if you could have a look into this issue
Kind regards
Esteban Lombeyda