Affects: 6.1.3
StringUtils.uriDecode
will take two different paths depending if "%" is found. One of these does not handle non-ASCII characters.
Fast path:
StringUtils.uriDecode("ü", StandardCharsets.UTF_8) // returns "ü"
Replace path:
StringUtils.uriDecode("%20ü", StandardCharsets.UTF_8) // returns " �"
Comment From: dumbbelloper
Hello, I've submitted a Pull Request that aims to address this issue: PR #32373
Comment From: poutsma
StringUtils::uriDecode expects the input to be encoded, which means that the ü
character should have been provided as %C3%BC
instead. I will add a documentation note that makes this behavior clear.
Note that StringUtils::uriDecode
is a low-level, internal utility method exposed via higher-level components, such as UriComponentsBuilder
, that are better at dealing with [en|de]coded URIs.