module Ronin::Support::Encoding::QuotedPrintable

Contains methods for encoding/decoding [Quoted Printable] data.

[Quoted-Printable]: en.wikipedia.org/wiki/Quoted-printable

## Core-Ext Methods

@api public

Public Class Methods

decode(data) click to toggle source

Alias for {unescape}.

@param [String] data

The Quoted-Printable String to unescape.

@return [String]

The unescaped String.

@see unescape

# File lib/ronin/support/encoding/quoted_printable.rb, line 101
def self.decode(data)
  unescape(data)
end
encode(data) click to toggle source

Alias for {escape}.

@param [String] data

The data to escape.

@return [String]

The quoted-printable escaped String.

@see escape

# File lib/ronin/support/encoding/quoted_printable.rb, line 67
def self.encode(data)
  escape(data)
end
escape(data) click to toggle source

Escapes the data as [Quoted-Printable].

[Quoted-Printable]: en.wikipedia.org/wiki/Quoted-printable

@param [String] data

The data to escape.

@return [String]

The quoted-printable escaped String.

@example

Encoding::QuotedPrintable.escape('<a href="https://example.com/">link</a>')
# => "<a href=3D\"https://example.com/\">link</a>=\n"
# File lib/ronin/support/encoding/quoted_printable.rb, line 52
def self.escape(data)
  [data].pack('M')
end
unescape(data) click to toggle source

Unescapes a [Quoted-Printable] encoded String.

[Quoted-Printable]: en.wikipedia.org/wiki/Quoted-printable

@param [String] data

The Quoted-Printable String to unescape.

@return [String]

The unescaped String.

@example

Encoding::QuotedPrintable.unescape("<a href=3D\"https://example.com/\">link</a>=\n")
# => "<a href=\"https://example.com/\">link</a>"
# File lib/ronin/support/encoding/quoted_printable.rb, line 86
def self.unescape(data)
  data.unpack1('M')
end