Fix JRuby handling of EncodedStrings

JRuby throws Encoding::InvalidByteSequenceError instead of Encoding::UndefinedConversionError for our ASCII-8BIT strings