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(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)); 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(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(); }