Пример #1
0
 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()];
 }
Пример #2
0
 private Entry findEntryFromEncoding(Encoding e) {
   if (e == null) return null;
   return findEncodingEntry(new ByteList(e.getName()));
 }
Пример #3
0
 private RubyEncoding(Ruby runtime, Encoding encoding) {
   super(runtime, runtime.getEncoding());
   this.name = new ByteList(encoding.getName());
   this.isDummy = false;
   this.encoding = encoding;
 }