is there any chance that a StringIO will have set_encoding but not external_encoding? If this is a known thing between Ruby versions OK, but just wondering as this reads differently