Table of Contents

Class MailTextBounds

Namespace
MailFathom.Domain.Emails
Assembly
MailFathom.Domain.dll

Cuts mail-derived text to a length without leaving a string a consumer cannot carry.

public static class MailTextBounds
Inheritance
MailTextBounds
Inherited Members

Remarks

Every value MailFathom derives from a message — a file name, a subject, a body — is bounded somewhere, because nothing between the sender and local storage bounds it. Cutting at a fixed number of UTF-16 code units would split a surrogate pair or a combining sequence, so text ending in an emoji could keep a lone high surrogate: a JSON writer replaces or rejects that, and PostgreSQL rejects it outright. The cut therefore falls on a text-element boundary, which also keeps a flag or skin-tone sequence whole.

Methods

TruncateAtTextElementBoundary(string, int)

Cuts text to at most a number of characters, never through the middle of one.