Examples of force_encoding()


Examples of org.jruby.RubyString.force_encoding()

    private RubyString reinterpretEncoding(ThreadContext context,
            RubyString str, String sniffedEncoding) {
        RubyEncoding actualEncoding = info.getEncoding(context, sniffedEncoding);
        RubyEncoding targetEncoding = info.utf8.get();
        RubyString dup = (RubyString)str.dup();
        dup.force_encoding(context, actualEncoding);
        return (RubyString)dup.encode_bang(context, targetEncoding);
    }

    /**
     * <code>Parser#parse()</code>
 
View Full Code Here

Examples of org.jruby.RubyString.force_encoding()

        }

        RubyString string = runtime.newString(new ByteList(bytes, true));
       
        if (!encoding.isNil()) {
            string.force_encoding(context, encoding);
        }
       
        return string;
    }
   
View Full Code Here

Examples of org.jruby.RubyString.force_encoding()

        {
            case 1:
                output.setEncodingAndCodeRange(USASCII, RubyObject.USER8_F);
                break;
            case 2:
                output.force_encoding(runtime.getCurrentContext(),
                        runtime.getEncodingService().convertEncodingToRubyEncoding(UTF8));
                break;
            default:
                /* do nothing, keep ASCII-8BIT */
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.