public static String normalize(final String name) {
        if (name == null) {
            throw new IllegalArgumentException("name cannot be null");
        }

        StringBuilder sb = new StringBuilder();

        for (char c : name.toCharArray()) {
            if (RESERVED.contains(c)) {
                sb.append('%').append((c < 16) ? "0" : "")
                        .append(Integer.toHexString(c).toUpperCase(Locale.ROOT));
            } else {
                sb.append(c);
            }
        }

        return sb.toString();
    }
Scans the given file name for reserved characters on different OSs and
file systems and returns a sanitized version of the name with the
reserved chars replaced by their hexadecimal value.
<p>
For example <code>why?.zip</code> will be converted into <code>why%3F.zip</code>

@param name the file name to be normalized - NOT NULL
@return the normalized file name
@throws IllegalArgumentException if name is null
tika-core/src/main/java/org/apache/tika/io/FilenameUtils.java