Package com.fasterxml.storemate.shared.util

Examples of com.fasterxml.storemate.shared.util.UTF8UrlEncoder


    /**********************************************************************
     */

    public void testEncoding()
    {
        UTF8UrlEncoder enc = new UTF8UrlEncoder(true);
        assertEquals("This%3A+%C2%A9...", enc.encode("This: \u00A9...", false));
        assertEquals("here/then", enc.encode("here/then", false));
        assertEquals("here%2Fthen", enc.encode("here/then", true));
    }
View Full Code Here


    /**********************************************************************
     */

    public void testDecoding()
    {
        UTF8UrlEncoder enc = new UTF8UrlEncoder(true);

        // slash handling
        assertEquals("here/then", enc.decode("here/then"));
        assertEquals("here/then", enc.decode("here%2Fthen"));
       
        // non-ASCII:
        assertEquals("This: \u00A9...", enc.decode("This%3A+%C2%A9..."));
        assertEquals("test/Stuff-\u00A9", enc.decode("test/Stuff-%C2%A9"));
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.storemate.shared.util.UTF8UrlEncoder

Copyright © 2018 www.massapicom. 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.