/** * 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); }
public Encoding getFileSystemEncoding() { return SpecialEncoding.FILESYSTEM.toEncoding(runtime); }
public Encoding getFileSystemEncoding(Ruby runtime) { return SpecialEncoding.FILESYSTEM.toEncoding(runtime); }
public Encoding getFileSystemEncoding(Ruby runtime) { return SpecialEncoding.FILESYSTEM.toEncoding(runtime); }
public Encoding getFileSystemEncoding() { return SpecialEncoding.FILESYSTEM.toEncoding(runtime); }
/** * 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); }
public Encoding getEncodingFromString(String string) { if (string == null) return null; ByteList name = new ByteList(ByteList.plain(string)); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return special.toEncoding(runtime); } return findEncodingWithError(name); }
public Encoding getEncodingFromString(String string) { if (string == null) return null; ByteList name = new ByteList(ByteList.plain(string)); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return special.toEncoding(runtime); } return findEncodingWithError(name); }
private Encoding findEncodingCommon(IRubyObject str, boolean error) { ByteList name = str.convertToString().getByteList(); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return special.toEncoding(runtime); } if (error) return findEncodingWithError(name); Entry e = findEncodingOrAliasEntry(name); if (e == null) return null; return e.getEncoding(); }
private Encoding findEncodingCommon(ByteList name, boolean error) { checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return special.toEncoding(runtime); } if (error) return findEncodingWithError(name); Entry e = findEncodingOrAliasEntry(name); if (e == null) return null; return e.getEncoding(); }
public Encoding getEncodingFromString(String string) { if (string == null) return null; ByteList name = new ByteList(ByteList.plain(string), false); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return special.toEncoding(runtime); } return findEncodingWithError(name); }
private Encoding findEncodingCommon(ByteList name, boolean error) { checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return special.toEncoding(runtime); } if (error) return findEncodingWithError(name); Entry e = findEncodingOrAliasEntry(name); if (e == null) return null; return e.getEncoding(); }
public Encoding getEncodingFromString(String string) { if (string == null) return null; ByteList name = new ByteList(ByteList.plain(string), false); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return special.toEncoding(runtime); } return findEncodingWithError(name); }
private Encoding findEncodingCommon(IRubyObject str, boolean error) { ByteList name = str.convertToString().getByteList(); checkAsciiEncodingName(name); SpecialEncoding special = SpecialEncoding.valueOf(name); if (special != null) { return special.toEncoding(runtime); } if (error) return findEncodingWithError(name); Entry e = findEncodingOrAliasEntry(name); if (e == null) return null; return e.getEncoding(); }