Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class String
- def to_quoted_printable(*args)
- [self].pack("M").gsub(/\n/, "\r\n")
- end
- def from_quoted_printable
- self.gsub(/\r\n/, "\n").unpack("M").first
- end
- end
- def quote_text_if_necessary(text)
- # text = text.gsub( /[^a-z ]/i ) { quote_char($&) }.
- # gsub( / /, "_" )
- # text
- [text].pack("M").gsub(/\n/, "\r\n")
- end
- def quote_if_necessary(text, charset)
- # text = text.gsub( /[^a-z ]/i ) { quote_char($&) }.gsub( / /, "_" )
- text = [text].pack("M").gsub(/\n/, "\r\n").gsub( / /, "_" )
- "=?#{charset}?Q?#{text}?="
- end
Add Comment
Please, Sign In to add comment