protected String encodeURLParameterValue(String value, ExternalContext externalContext) {
        try {
            return URLEncoder.encode(value, externalContext.getResponseCharacterEncoding());
        }
        catch (UnsupportedEncodingException e) {
            throw new UnsupportedOperationException("Encoding type="
                    + externalContext.getResponseCharacterEncoding() + " not supported", e);
        }
    }
Encodes the given value using URLEncoder.encode() with the charset returned
from ExternalContext.getResponseCharacterEncoding().
This is exactly how the ExternalContext impl encodes URL parameter values.

@param value           value which should be encoded
@param externalContext current external-context
@return encoded value
primefaces/src/main/java/org/primefaces/clientwindow/PrimeClientWindow.java