The rfc2047 ruby gem decodes email header fields that have been encoded according the the rules layed forth by RFC 2047.
Rfc2047.decode("=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=") # => "If you can read this yo u understand the example."
It is released under the same terms as Ruby itself.
It was originally written by Sam Roberts in 2003, and the current version was taken from the Joyent Connector, who cite the original mailing list post as the source. It was packaged as a gem in 2011, and now resides on Rubygems, with the source at GitHub.