EPIC Enhanced Programmable IRC-II Client

Mangle types

Description

Mangle types select transformations of text and formatting controls. They are used by lastlog -mangle, log mangle, the mangle_display, mangle_inbound, mangle_outbound, and mangle_logfiles settings, and stripcrap. The status bar also uses the display normalizer.

These transformations operate on text and attributes, not on IRC message categories or character-set selection. EPIC processes Unicode code points internally; byte ranges from an eight-bit encoding do not describe normal non-ASCII Unicode text.

Specifying options

Options are case-insensitive and can be comma- or space-separated. A name enables its transformation; prefixing it with - disables that flag. none or -all clears the flags accumulated so far. Settings update their existing mask, so use an explicit reset when replacing the whole selection:

/set mangle_display none,normalize,color

This selects normalization and color removal. The setting's displayed value is a canonical list of recognized flag names. Unknown tokens are silently ignored; short prefixes are accepted through fixed prefix tests, so use full documented names.

Options

Type Effect when the normalizer runs
normalize (also ansi) Interpret supported terminal escape sequences and IRC color sequences as attributes, discard carriage returns, and display otherwise ordinary control characters using a reverse-video representation. This is not a full terminal emulator.
escape Replace Escape itself with a reverse-video [; the following characters remain available as ordinary text. This takes priority over escape-sequence normalization.
color Consume IRC color sequences and clear foreground/background color attributes. Combined with normalize, also removes colors obtained from supported terminal escape sequences.
reverse Suppress reverse-video toggles and reverse attributes parsed from terminal sequences.
underline Suppress underline toggles and parsed underline attributes.
bold Suppress bold toggles and parsed bold attributes.
blink Suppress blink toggles and parsed blink attributes.
alt_char Suppress alternate-character-set toggles and attributes.
nd_space Remove non-destructive-space markers and suppress such spacing generated by supported escape sequences.
all_off Ignore the IRC all-attributes-off control rather than resetting attributes at that point. It does not mean “disable all mangling.”
unprintable Discard formatting-toggle controls, ordinary control characters, carriage returns, bells, and the Escape/color introducer characters. It does not necessarily consume the text following an introducer.
other Discard ordinary text, tabs, and non-destructive-space markers. This removes printable content rather than merely removing formatting.

all is a special preset: it enables normalization and attribute stripping, but deliberately excludes escape, other, and unprintable. It therefore does not mean “set every flag.” It also sets an internal italic-stripping bit, although italic is not accepted as a standalone option and is not included in the canonical displayed flag list. Saving and reapplying that list is not an exact representation of every internal bit in the preset.

Character handling

Even with no optional flags selected, a call to the normalizer interprets IRC formatting toggles, expands tabs to eight-column tab stops, and discards C1 control code points U+0080–U+009F. Ordinary non-ASCII Unicode characters from U+00A0 upward are retained unless other removes them. Input is a NUL-terminated string, so embedded NUL ends it.

Recognized formatting includes bold, reverse, blink, underline, alternate charset, italic, all-off, ordinary IRC color, and extended color controls. The caller chooses how resulting attributes are represented: display and status use internal markers, while wire/log transformations normally emit IRC-style controls. A transformation result is therefore not always plain text, and different callers can represent the same attributes differently.

Some call sites skip normalization entirely when their mask is zero. In particular, none on an inbound or outbound setting does not mean “run the normalizer with no flags.” Display normalization is still part of the display path.

Interactions and priority

Because escape leaves sequence tails visible and unprintable can leave color parameters visible, neither is equivalent to parsing and removing an entire control sequence. Attribute stripping can also affect the interpretation of later resets or toggles; choose options for the intended output stage.

Settings and effects

The built-in mangle_display default is normalize. The inbound, outbound, and logfile settings initially have no selected flags. Changing a setting does not rewrite text already displayed or logged.

Display mangling affects local rendering. Inbound mangling operates on an incoming IRC line before command parsing; outbound mangling can alter outgoing command text and payload. Applying broad stripping there can change protocol data, not just its appearance. Logging and lastlog have their own call paths and defaults; consult their pages rather than assuming the display setting controls saved text.

Source references