/** * Find an encoding given a Ruby object, coercing it to a String in the process. * * @param str the object to coerce and use to look up encoding. The coerced String * must be ASCII-compatible. * @return the Encoding object found, nil (for internal), or raises ArgumentError */ public Entry findEntry(IRubyObject str) { ByteList name = str.convertToString().getByteList(); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return findEntryFromEncoding(special.toEncoding(runtime)); } return findEntryWithError(name); }
/** * Find an encoding given a Ruby object, coercing it to a String in the process. * * @param str the object to coerce and use to look up encoding. The coerced String * must be ASCII-compatible. * @return the Encoding object found, nil (for internal), or raises ArgumentError */ public Entry findEntry(IRubyObject str) { ByteList name = str.convertToString().getByteList(); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return findEntryFromEncoding(special.toEncoding(runtime)); } return findEntryWithError(name); }
/** * Find an encoding given a Ruby object, coercing it to a String in the process. * * @param str the object to coerce and use to look up encoding. The coerced String * must be ASCII-compatible. * @return the Encoding object found, nil (for internal), or raises ArgumentError */ public Entry findEntry(IRubyObject str) { ByteList name = str.convertToString().getByteList(); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return findEntryFromEncoding(special.toEncoding(runtime)); } return findEntryWithError(name); }
/** * Find an encoding given a Ruby object, coercing it to a String in the process. * * @param str the object to coerce and use to look up encoding. The coerced String * must be ASCII-compatible. * @return the Encoding object found, nil (for internal), or raises ArgumentError */ public Entry findEntry(IRubyObject str) { ByteList name = str.convertToString().getByteList(); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return findEntryFromEncoding(special.toEncoding(runtime)); } return findEntryWithError(name); }