module Mail::Jenc::PercentEncoder

Public Class Methods

encode(str) click to toggle source
# File lib/mail/jenc/encoder.rb, line 5
def encode(str)
  encode_to_array(str).join
end
encode_to_array(str) click to toggle source
# File lib/mail/jenc/encoder.rb, line 9
def encode_to_array(str)
  str.unpack('H*').first.scan(/.{2}/).map { |hex| "%#{hex.upcase}" }
end