Skip to main content

Module escape

Module escape 

Source
Expand description

RFC 5545 §3.3.11 TEXT value escape handling.

Typed TEXT fields (SUMMARY, DESCRIPTION, individual CATEGORIES items, etc.) carry the following escape sequences on the wire:

wiremeaning
\\backslash
\;semicolon
\,comma
\n or \Nnewline (LF)

On parse we decode; on format we re-encode. Per ADR-018, RawProperty.value stays raw — escapes are only interpreted for fields the typed model understands and re-emits.

Functions§

decode_text
Decode a single TEXT value into a Rust String, interpreting the escape sequences above. Unknown escape sequences (\X for X not in the recognized set) pass through with the backslash preserved, so a future spec evolution can decide their meaning without a corrupting round-trip in the meantime.
encode_text
Encode a Rust string for the wire, escaping the four reserved characters that would otherwise be interpreted as structure.
join_text_list
Encode an item list into a single TEXT value, comma-joined with each item internally escaped.
split_text_list
Split a multi-value TEXT property’s raw wire value into individual decoded items, respecting \, as a literal comma inside an item.