public static String createContentDisposition(String value, String filename) {
        try {
            return String.format("%s;filename=\"%2$s\"; filename*=UTF-8''%2$s", value, encodeURI(filename));
        }
        catch (UnsupportedEncodingException e) {
            throw new FacesException(e);
        }
    }
Creates an RFC 6266 Content-Dispostion header following all UTF-8 conventions.
<p>
@param value e.g. "attachment"
@param filename the name of the file
@return a valid Content-Disposition header in UTF-8 format
primefaces/src/main/java/org/primefaces/util/ComponentUtils.java