Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
irb(main):001:0> source = "=?ISO-2022-JP?B?GyRCIXcbKEJJVBskQj83Q2VCLkpzGyhCIC0=?= =?ISO-2022-JP?B?IDIwMTAvOS8zGyRCISEbKEI=?= =?ISO-2022-JP?B?GyRCOkdNJUBoO3Y5YCRPIUhAZEJQJW0bKEI=?= =?ISO-2022-JP?B?GyRCITwlcyVBJDUkOyRrJDMkSCEqIUkbKEI=?="
=> "=?ISO-2022-JP?B?GyRCIXcbKEJJVBskQj83Q2VCLkpzGyhCIC0=?= =?ISO-2022-JP?B?IDIwMTAvOS8zGyRCISEbKEI=?= =?ISO-2022-JP?B?GyRCOkdNJUBoO3Y5YCRPIUhAZEJQJW0bKEI=?= =?ISO-2022-JP?B?GyRCITwlcyVBJDUkOyRrJDMkSCEqIUkbKEI=?="
irb(main):002:0> require 'kconv'
=> true
irb(main):003:0> source.toutf8()
error:
=> "@IT新着速報 -"
except:
=> "@IT新着速報 - 2010/9/3 最優先事項は“絶対ローンチさせること!”"
def decode_subject (subject)
res = ""
subject.split(' ').each do |word|
res = res + NKF.nkf("-dJw", word)
end
return res
end
@kompiro
Copy link
Author

kompiro commented Sep 5, 2010

NKF.nkf("-wJ",source)を繰り返すと、それぞれの=?ISO-2022-JP...の区間ごとのデコードできる。

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment