Class Index [+]

Quicksearch

Mail::Encodings::QuotedPrintable

Constants

NAME
PRIORITY

Public Class Methods

can_encode?(str) click to toggle source
    # File lib/mail/encodings/quoted_printable.rb, line 11
11:       def self.can_encode?(str)
12:         EightBit.can_encode? str
13:       end
cost(str) click to toggle source
    # File lib/mail/encodings/quoted_printable.rb, line 24
24:       def self.cost(str)
25:         # These bytes probably do not need encoding
26:         c = str.count("\x9\\xA\\xD\\x20-\x3C\x3E-\x7E")
27:         # Everything else turns into =XX where XX is a 
28:         # two digit hex number (taking 3 bytes)
29:         total = (str.bytesize - c)*3 + c
30:         total.to_f/str.bytesize
31:       end
decode(str) click to toggle source

Decode the string from Quoted-Printable

    # File lib/mail/encodings/quoted_printable.rb, line 16
16:       def self.decode(str)
17:         str.unpack("M*").first
18:       end
encode(str) click to toggle source
    # File lib/mail/encodings/quoted_printable.rb, line 20
20:       def self.encode(str)
21:         [str].pack("M").gsub(/\n/, "\r\n")
22:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.