Add support for default_internal result transcoding
Via Yehuda Katz in [[http://yehudakatz.com/2010/05/17/encodings-unabridged/|his blog article about encodings]]:
[I]t is still possible that some non-BINARY data sneaks over the boundary and into our Rails application from a non-UTF-8 source.
For this scenario, Ruby 1.9 provides an option called Encoding.default_internal, which allows the user to specify an preferred encoding for Strings. Ruby itself and Ruby’s standard libraries respect this option, so even if, for instance, it opens some IO encoded in ISO-8859-1, it will give the data to the Ruby program transcoded to the preferred encoding.
Libraries, such as database drivers, should also support this option, which means that even if the database is somehow set up to receive UTF-8 String, the driver should convert those String transparently to the preferred encoding before handing it to the program.
Rails can take advantage of this by setting the default_internal to UTF-8, which will then ensure that String from non-UTF-8 sources still make their way into Rails encoded as UTF-8.
I'll add this ASAP, and 0.9.1 will include support for it.