os97673/regexp_m17n — pull request #41 by eskadah (2014-08-05 06:04:40+00:00)
Title: Solution using IRB's String#force_encoding behavior for rescuing Encoding Errors 

IRB has a subtle difference in behavior when it comes to encodings. An Encoding::ConverterNotFoundError is not raised during forced conversions to UTF-7 and ISO-2022-JP-2. In particular, this error is raised by the given test suite when it attempts to encode the input argument to UTF-7 and ISO-2022-JP-2. On Ruby 2.0 and Ruby 1.9,3(MRI, OSX10.9) these conversions raise an exception and prevent the test suite from completing its run when evaluated in the default US-ASCII format. IRB is natively encoded in the UTF-8 format on a MAC. A simple trick to encapsulate the preferred IRB Behavior is to open a pipe to an external shell and compare its output for '\x2E'. This behavior is demonstrated in the test suite