Knowledge Base

Text Field Escape Codes

Text fields marked with a console/terminal icon can contain backslash-style escape codes for encoding newlines, carriage returns, unprintable characters, or any arbitrary byte.

Usage

Every escape code begins with a backslash, and then either a single character representing a built-in escapable character, or an "x" and two case-insensitive hexadecimal digits. See the examples below for more information.

Special Escape Codes

The following list contains all the built-in escapable characters; any other non-printable character must be encoded as a byte:

  • \\ – single backslash
  • \a – bell/alert
  • \b – backspace
  • \d – delete
  • \e – escape
  • \f – form feed
  • \n – newline
  • \r – carriage return
  • \s – space
  • \t – tab
  • \v – vertical tab
  • \0 – null byte

Examples

  • \r\n – the CR+LF grapheme
  • \xAF\xFF – two arbitrary bytes with values AF and FF in hexadecimal
  • QUIT\r\n – FTP QUIT command
  • QUIT\x0d\x0a – FTP QUIT command as above, but using byte syntax instead