private final IRubyObject inspect19(Ruby runtime) { ByteList result = new ByteList(symbolBytes.getRealSize() + 1); result.setEncoding(symbolBytes.getEncoding()); result.append((byte)':'); result.append(symbolBytes); RubyString str = RubyString.newString(runtime, result); // TODO: 1.9 rb_enc_symname_p if (isPrintable() && isSymbolName19(symbol)) return str; str = (RubyString)str.inspect19(); ByteList bytes = str.getByteList(); bytes.set(0, ':'); bytes.set(1, '"'); return str; }
private final IRubyObject inspect19(Ruby runtime) { ByteList result = new ByteList(symbolBytes.getRealSize() + 1); result.setEncoding(symbolBytes.getEncoding()); result.append((byte)':'); result.append(symbolBytes); RubyString str = RubyString.newString(runtime, result); // TODO: 1.9 rb_enc_symname_p if (isPrintable() && isSymbolName19(symbol)) return str; str = (RubyString)str.inspect19(); ByteList bytes = str.getByteList(); bytes.set(0, ':'); bytes.set(1, '"'); return str; }
final RubyString inspect(final Ruby runtime) { // TODO: 1.9 rb_enc_symname_p Encoding resenc = runtime.getDefaultInternalEncoding(); if (resenc == null) resenc = runtime.getDefaultExternalEncoding(); RubyString str = RubyString.newString(runtime, symbolBytes); if (!(isPrintable() && (resenc.equals(symbolBytes.getEncoding()) || str.isAsciiOnly()) && isSymbolName19(symbol))) { str = str.inspect(runtime); } ByteList result = new ByteList(str.getByteList().getRealSize() + 1); result.setEncoding(str.getEncoding()); result.append((byte)':'); result.append(str.getBytes()); return RubyString.newString(runtime, result); }
final RubyString inspect(final Ruby runtime) { // TODO: 1.9 rb_enc_symname_p Encoding resenc = runtime.getDefaultInternalEncoding(); if (resenc == null) resenc = runtime.getDefaultExternalEncoding(); RubyString str = RubyString.newString(runtime, symbolBytes); if (!(isPrintable() && (resenc.equals(symbolBytes.getEncoding()) || str.isAsciiOnly()) && isSymbolName19(symbol))) { str = str.inspect(runtime); } ByteList result = new ByteList(str.getByteList().getRealSize() + 1); result.setEncoding(str.getEncoding()); result.append((byte)':'); result.append(str.getBytes()); return RubyString.newString(runtime, result); }