I am using java’s URLEncoder to take a user provided string and create a string that is safe to use for filenames. What I’m wondering is it possible for two different strings to be encoded to the same value.
For example, if one string is “ABC%20D” but since % is used as a character to replace special characters is it possible that something like “ABC D” and “ABC%20D” both end up as the same encoded value? Or will the encoder always replace characters like % with something else?
It seems to encode escape characters using your example input: