formatting.md
-
Janne Mareike Koschinski authoredJanne Mareike Koschinski authored
Formatting
!!! info This page is adapted and extended from http://modern.ircdocs.horse/formatting.html, https://www.mirc.com/colors.html and http://m8y.org/tmp/extended_mirc_color_proposal.html
!!! summary "Authors"
Original Creator
Daniel Oaks
http://modern.ircdocs.horse/formatting.html
daniel@danieloaks.net
**Adapted and Extended By**
[Janne Koschinski](https://kuschku.de/)
*support@kuschku.de*
!!! warning This document describes the current situation of what clients implement. It is therefore subject to change, and should not be understood as strict specification.
In case of mistakes, please [contact me](mailto:support@kuschku.de).
Introduction
IRC clients today understand a number of special formatting characters. These characters allow IRC software to send and receive colors and formatting codes such as bold, italics, underline and others.
Over the years, many clients have attempted to create their own methods of formatting and there have been variations and extensions of almost every method. However, the characters and codes described in this document are understood fairly consistently across clients today.
Following what's described in this document should let your software send and interpret formatting in a fairly sane way, consistent with how most other IRC software out there does. Using formatting characters and methods not described in this document is possible, but it should be assumed they will not work across most clients (unless there is some way to fall back to what's defined here).
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC2119.
Formatting Uses
Formatting is widely used in IRC. In this section, we outline the places where formatting is traditionally used by clients and allowed by servers. This is not an expansive list nor does it note everywhere formatting is used, just some of the most common places.
Messages / Numerics
Formatting characters can be used in lots of IRC messages and numerics. This is not a complete list, just some of the messages formatting codes are used with most often.
These are some of the messages and features formatting codes are normally used with:
And the numerics containing content associated with these messages and features.
Names
Formatting is allowed and commonly used in realnames (set with the USER
command when the
client joins the network).
On some networks and with some server software, vhosts (vanity hostnames) may contain formatting characters and codes. Hostnames sent to clients MAY contain formatting, and clients SHOULD display them with this in mind.
The use of formatting MUST NOT be allowed in nicknames, user names or channel names. This is to avoid confusion and prevent issues, particularly with clients that have disabled the rendering of colors / formatting or cannot display certain types of formatting.
If a client sends a USER
command with any formatting codes in the first parameter (in the
username) during registration, the server SHOULD send the client an ERROR
message and
close the connection.
Client Behaviour
This section is non-normative and outlines suggested behaviour for clients and client interfaces.
Limitations
If an IRC client cannot display a specified type of formatting, the client should do one of the following:
- Simply not display the formatting.
- Display the formatting character in an obvious way, so users are aware that it was used.