public void call(byte[] source, byte[] destination, int depth) { IRubyObject v; if (convpath[0] == nil) { convpath[0] = runtime.newArray(); } if (EncodingUtils.DECORATOR_P(encNames[0], encNames[1])) { v = RubyString.newString(runtime, encNames[2]); } else { v = runtime.newArray( es.convertEncodingToRubyEncoding(es.findEncodingOrAliasEntry(source).getEncoding()), es.convertEncodingToRubyEncoding(es.findEncodingOrAliasEntry(destination).getEncoding())); } ((RubyArray)convpath[0]).store(depth, v); } });
public void call(byte[] source, byte[] destination, int depth) { IRubyObject v; if (convpath[0] == nil) { convpath[0] = runtime.newArray(); } if (EncodingUtils.DECORATOR_P(encNames[0], encNames[1])) { v = RubyString.newString(runtime, encNames[2]); } else { v = runtime.newArray( es.convertEncodingToRubyEncoding(es.findEncodingOrAliasEntry(source).getEncoding()), es.convertEncodingToRubyEncoding(es.findEncodingOrAliasEntry(destination).getEncoding())); } ((RubyArray)convpath[0]).store(depth, v); } });
dname[0] = elt.convertToString().getBytes(); if (DECORATOR_P(sname[0], dname[0])) { boolean ret = ec.addConverter(sname[0], dname[0], ec.numTranscoders); if (!ret) {
dname[0] = elt.convertToString().getBytes(); if (DECORATOR_P(sname[0], dname[0])) { boolean ret = ec.addConverter(sname[0], dname[0], ec.numTranscoders); if (!ret) {
if (!EncodingUtils.DECORATOR_P(encNames[0], encNames[1])) { if (encs[0] == null) { encs[0] = EncodingDB.dummy(encNames[0]).getEncoding();
if (!EncodingUtils.DECORATOR_P(encNames[0], encNames[1])) { if (encs[0] == null) { encs[0] = EncodingDB.dummy(encNames[0]).getEncoding();
@JRubyMethod public IRubyObject convpath(ThreadContext context) { Ruby runtime = context.runtime; RubyArray result = runtime.newArray(); for (int i = 0; i < ec.numTranscoders; i++) { Transcoder tr = ec.elements[i].transcoding.transcoder; IRubyObject v; if (EncodingUtils.DECORATOR_P(tr.getSource(), tr.getDestination())) { v = RubyString.newString(runtime, tr.getDestination()); } else { v = runtime.newArray( runtime.getEncodingService().convertEncodingToRubyEncoding(runtime.getEncodingService().findEncodingOrAliasEntry(tr.getSource()).getEncoding()), runtime.getEncodingService().convertEncodingToRubyEncoding(runtime.getEncodingService().findEncodingOrAliasEntry(tr.getDestination()).getEncoding())); } result.push(v); } return result; }
@JRubyMethod public IRubyObject convpath(ThreadContext context) { Ruby runtime = context.runtime; RubyArray result = runtime.newArray(); for (int i = 0; i < ec.numTranscoders; i++) { Transcoder tr = ec.elements[i].transcoding.transcoder; IRubyObject v; if (EncodingUtils.DECORATOR_P(tr.getSource(), tr.getDestination())) { v = RubyString.newString(runtime, tr.getDestination()); } else { v = runtime.newArray( runtime.getEncodingService().convertEncodingToRubyEncoding(runtime.getEncodingService().findEncodingOrAliasEntry(tr.getSource()).getEncoding()), runtime.getEncodingService().convertEncodingToRubyEncoding(runtime.getEncodingService().findEncodingOrAliasEntry(tr.getDestination()).getEncoding())); } result.push(v); } return result; }
if (tr == null) return -1; if (!DECORATOR_P(tr.getSource(), tr.getDestination()) && tr.compatibility.isEncoder()) { n--;
if (tr == null) return -1; if (!DECORATOR_P(tr.getSource(), tr.getDestination()) && tr.compatibility.isEncoder()) { n--;