All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javaswift.joss.util.SpaceURLEncoder Maven / Gradle / Ivy

There is a newer version: 0.10.4
Show newest version
package org.javaswift.joss.util;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * The purpose of this class is to supplement URLEncode.encode with the option to convert
 * '+' into %20.
 * See also: 
 * http://stackoverflow.com/questions/4737841/urlencoder-not-able-to-translate-space-character
 * @author Robert Bor
 */
public class SpaceURLEncoder {

    public static String encode(String value) throws UnsupportedEncodingException {
        return URLEncoder.encode(value, "UTF-8").replace("+", "%20");
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy