One rule for every byte
Each octet is either kept or escaped. Bytes 33-126, the printable ASCII range, are written as themselves, with one exception: the equals sign (byte 61) must become =3D. Everything else, including control characters, DEL, and bytes 128-255, is written as =XX in uppercase hex. Because the input is UTF-8 text, an accented character usually occupies two or three bytes and produces that many escape sequences; decoding inverts the rule.