private ByteList decodeMimeString(String str) { String[] mime = str.split("^=\\?|\\?|\\?=$"); String charset = detectCharset(mime[1]); int encode = mime[2].charAt(0); ByteList body = new ByteList(mime[3].getBytes(), ASCIIEncoding.INSTANCE); final RubyArray array; if ('B' == encode || 'b' == encode) { // BASE64 array = Pack.unpack(context.runtime, body, PACK_BASE64); } else { // Qencode array = Pack.unpack(context.runtime, body, PACK_QENCODE); } RubyString s = (RubyString) array.entry(0); ByteList decodeStr = s.asString().getByteList(); return convert_byte(decodeStr, charset, options.get("output")); }
private ByteList decodeMimeString(String str) { String[] mime = str.split("^=\\?|\\?|\\?=$"); String charset = detectCharset(mime[1]); int encode = mime[2].charAt(0); ByteList body = new ByteList(mime[3].getBytes(), ASCIIEncoding.INSTANCE); RubyArray array = null; if ('B' == encode || 'b' == encode) { // BASE64 array = Pack.unpack(context.runtime, body, PACK_BASE64); } else { // Qencode array = Pack.unpack(context.runtime, body, PACK_QENCODE); } RubyString s = (RubyString) array.entry(0); ByteList decodeStr = s.asString().getByteList(); return convert_byte(decodeStr, charset, options.get("output")); }
private ByteList decodeMimeString(String str) { String[] mime = str.split("^=\\?|\\?|\\?=$"); String charset = detectCharset(mime[1]); int encode = mime[2].charAt(0); ByteList body = new ByteList(mime[3].getBytes(), ASCIIEncoding.INSTANCE); final RubyArray array; if ('B' == encode || 'b' == encode) { // BASE64 array = Pack.unpack(context.runtime, body, PACK_BASE64); } else { // Qencode array = Pack.unpack(context.runtime, body, PACK_QENCODE); } RubyString s = (RubyString) array.entry(0); ByteList decodeStr = s.asString().getByteList(); return convert_byte(decodeStr, charset, options.get("output")); }
private ByteList decodeMimeString(String str) { String[] mime = str.split("^=\\?|\\?|\\?=$"); String charset = detectCharset(mime[1]); int encode = mime[2].charAt(0); ByteList body = new ByteList(mime[3].getBytes(), ASCIIEncoding.INSTANCE); RubyArray array = null; if ('B' == encode || 'b' == encode) { // BASE64 array = Pack.unpack(context.runtime, body, PACK_BASE64); } else { // Qencode array = Pack.unpack(context.runtime, body, PACK_QENCODE); } RubyString s = (RubyString) array.entry(0); ByteList decodeStr = s.asString().getByteList(); return convert_byte(decodeStr, charset, options.get("output")); }
description = RubyObject.inspect(context, object).asString(); } catch (JumpException e) { context.setErrorInfo(context.nil);
description = RubyObject.inspect(context, object).asString(); } catch (JumpException e) { context.setErrorInfo(context.nil);