public RubyEncoding getEncoding(Encoding enc) { int index = enc.getIndex(); RubyEncoding rubyEncoding; if (index < encodingIndex.length && (rubyEncoding = encodingIndex[index]) != null) { return rubyEncoding; } enc = loadEncoding(new ByteList(enc.getName(), false)); return encodingIndex[enc.getIndex()]; }
private Entry findEntryFromEncoding(Encoding e) { if (e == null) return null; return findEncodingEntry(new ByteList(e.getName())); }
private RubyEncoding(Ruby runtime, Encoding encoding) { super(runtime, runtime.getEncoding()); this.name = new ByteList(encoding.getName()); this.isDummy = false; this.encoding = encoding; }