work around JRuby String.encode! issue

JRuby 1.6.7.2 (Ruby 1.9 mode) seems to have a bug in String.encode!
resulting in Encoding::ConverterNotFoundError being raised, however,
String.encode does not have this problem.

Call String.encode rather than String.encode! to dispel this error.