Preview a message
A notification tool counts, previews and size-limits UTF-8 messages.
What needs to change
Repair preview so a long message keeps exactly its first limit code points before the ellipsis.
Reproduce
- Compile and run the two-preview sample with g++, then compare both previews with the expected stdout.
Acceptance criteria
Your review marks · Saved in this browser. Test acceptance is tracked separately.
Notes
The file contains its headers, the Request struct, readRequests, characters and main. The browser compiles with g++ -std=c++23.
Input: a whole-number limit, one space, then the message.
Messages are valid UTF-8 and limits are nonnegative whole numbers. Characters means code points; no normalization or grapheme-preserving cut is required.