<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vmime/tests, branch master</title>
<subtitle>A powerful C++ class library for working with RFC-822 and MIME messages and Internet messaging services like IMAP, POP or SMTP.</subtitle>
<id>http://git.bktus.com/gpgfrontend/vmime/atom?h=master</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/vmime/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/'/>
<updated>2024-06-11T18:47:53Z</updated>
<entry>
<title>Fix a test failure in testNewFromString (#311)</title>
<updated>2024-06-11T18:47:53Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-06-11T18:47:53Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=aa60d004968aa8536251a6c0fedd3f1172add548'/>
<id>urn:sha1:aa60d004968aa8536251a6c0fedd3f1172add548</id>
<content type='text'>
Fixes an oversight in d296c2d1.</content>
</entry>
<entry>
<title>vmime: prevent loss of a space during text::createFromString (#306)</title>
<updated>2024-05-21T13:55:06Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-05-21T13:55:06Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=d296c2d1d590f8b4f619d9c555ff24ddecec1614'/>
<id>urn:sha1:d296c2d1d590f8b4f619d9c555ff24ddecec1614</id>
<content type='text'>
```
mailbox(text("Test München West", charsets::UTF_8), "a@b.de").generate();
```

produces

```
=?us-ascii?Q?Test_?= =?utf-8?Q?M=C3=BCnchen?= =?us-ascii?Q?West?= &lt;test@example.com&gt;
```

The first space between ``Test`` and ``München`` is encoded as an
underscore along with the first word: ``Test_``. The second space
between ``München`` and ``West`` is encoded with neither of the two
words and thus lost. Decoding the text results in ``Test
MünchenWest`` instead of ``Test München West``.

This is caused by how ``vmime::text::createFromString()`` handles
transitions between 7-bit and 8-bit words: If an 8-bit word follows a
7-bit word, a space is appended to the previous word. The opposite
case of a 7-bit word following an 8-bit word *misses* this behaviour.

When one fixes this problem, a follow-up issue appears:

``text::createFromString("a b\xFFc d")`` tokenizes the input into
``m_words={word("a "), word("b\xFFc ", utf8), word("d")}``. This
"right-side alignment" nature of the whitespace is a problem for
word::generate():

As per RFC 2047, spaces between adjacent encoded words are just
separators but not meant to be displayed. A space between an encoded
word and a regular ASCII text is not just a separator but also meant
to be displayed.

When word::generate() outputs the b-word, it would have to strip one
space, but only when there is a transition from encoded-word to
unencoded word. word::generate() does not know whether d will be
encoded or unencoded.

The idea now is that we could change the tokenization of
``text::createFromString`` such that whitespace is at the *start* of
words rather than at the end. With that, word::generate() need not
know anything about the next word, but rather only the *previous*
one.

Thus, in this patch,

1. The tokenization of ``text::createFromString`` is changed to
   left-align spaces and the function is fixed to account for
   the missing space on transition.
2. ``word::generate`` learns how to steal a space character.
3. Testcases are adjusted to account for the shifted
   position of the space.

Fixes: #283, #284

Co-authored-by: Vincent Richard &lt;vincent@vincent-richard.net&gt;</content>
</entry>
<entry>
<title>tests: switch a byte sequence in textTest (#305)</title>
<updated>2024-05-21T13:48:26Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-05-21T13:48:26Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=c105165c6e538a48a3713d41af7a2718a105eafb'/>
<id>urn:sha1:c105165c6e538a48a3713d41af7a2718a105eafb</id>
<content type='text'>
Switch out the byte sequence by one that is simiarly random, but one
which happens to decode as valid UTF-8, such that the expected and
actual strings are shown with reasonable characters on a terminal.</content>
</entry>
<entry>
<title>Fixes/comments for guessBestEncoding (#304)</title>
<updated>2024-05-21T13:47:05Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-05-21T13:47:05Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=b447adbe373d3940d2023d8e7a6ec21c7bfb8a48'/>
<id>urn:sha1:b447adbe373d3940d2023d8e7a6ec21c7bfb8a48</id>
<content type='text'>
* tests: add case for getRecommendedEncoding

* vmime: avoid integer multiply wraparound in wordEncoder::guessBestEncoding

If the input string is 42949673 characters long or larger, there will
be integer overflow on 32-bit platforms when multiplying by 100.
Switch that one computation to floating point.

* vmime: update comment in wordEncoder::guessBestEncoding</content>
</entry>
<entry>
<title>vmime: avoid changing SEVEN_BIT when encoding::decideImpl sees U+007F (#303)</title>
<updated>2024-05-21T13:45:29Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-05-21T13:45:29Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=97d15b8cd77998f37c279a023aa9f07def956e60'/>
<id>urn:sha1:97d15b8cd77998f37c279a023aa9f07def956e60</id>
<content type='text'>
* vmime: avoid changing SEVEN_BIT when encoding::decideImpl sees U+007F

Do not switch to QP/B64 when encountering U+007F.
U+007F is part of ASCII just as much as U+0001 is.

---------

Co-authored-by: Vincent Richard &lt;vincent@vincent-richard.net&gt;</content>
</entry>
<entry>
<title>url: strip leading slash from url-path (#298)</title>
<updated>2024-03-04T10:46:03Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-03-04T10:46:03Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=0ce327abee4666385ebb54a7530e4710b63265a3'/>
<id>urn:sha1:0ce327abee4666385ebb54a7530e4710b63265a3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>url: repair off-by-one bug in extractHost (#297)</title>
<updated>2024-03-04T10:45:49Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-03-04T10:45:49Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=c6b01fcc32956518ce010d4d367b844c006958d2'/>
<id>urn:sha1:c6b01fcc32956518ce010d4d367b844c006958d2</id>
<content type='text'>
`hostPart[len]` is pointing to `]`, but we need to check the
char after that.

Fixes: v0.9.2-187-g874a1d8c</content>
</entry>
<entry>
<title>url: support IPv6 literals (RFC 2732) (#292)</title>
<updated>2024-01-30T11:38:41Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-01-30T11:38:41Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=874a1d8c33ef80402be95a1ebee01902e14f12e4'/>
<id>urn:sha1:874a1d8c33ef80402be95a1ebee01902e14f12e4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed possible recursion crash when parsing mailbox groups.</title>
<updated>2022-01-25T09:28:20Z</updated>
<author>
<name>vincent-richard</name>
<email>vincent@vincent-richard.net</email>
</author>
<published>2022-01-25T09:28:20Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=561746081f633245b326e31e6ef0f2ef20b48ef6'/>
<id>urn:sha1:561746081f633245b326e31e6ef0f2ef20b48ef6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed Cppcheck issues.</title>
<updated>2021-11-25T20:57:07Z</updated>
<author>
<name>Vincent Richard</name>
<email>vincent@vincent-richard.net</email>
</author>
<published>2021-11-25T20:57:07Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=23ab2a6a3c927c99bfc1a0bedd94e283c05ca59d'/>
<id>urn:sha1:23ab2a6a3c927c99bfc1a0bedd94e283c05ca59d</id>
<content type='text'>
</content>
</entry>
</feed>
