os97673/regexp_m17n — pull request #106 by svyatov (2014-08-09 17:21:40+00:00)
Title: The complete solution without skipping any encoding (even UTF-7 :)

Based on my first solution: https://github.com/os97673/regexp_m17n/pull/40

I don't know if it's allowed to use `iconv` or not, that's why in my first solution I was trying to achieve the goal without using any additional libraries.

But. If we **can** use `iconv`, here is my second solution, which completely solves the problem without skipping any encoding, even dummy ones, even `UTF-7` :) In both MRI and JRuby, of course.

Methods for encoding/decoding `UTF-7` are borrowed from `Net::IMAP` ruby library. I could just `require 'net/imap'` and use the original methods, but for our purpose it's a huge overkill, I think. So I extracted and modified those methods instead. Everything else is handled by Iconv.

Other than that all my comments from my first solution are applied.