SlingUri should not "have an opinion" about when URIs should be encoded or not. It should be able to deal with invalid URIs in a best effort manner (e.g. URIs containing a space in the path are already invalid) and always try to not change the identity of the URI (means: UriBuilder.parse(inputStr,null).build().toString() should almost always be equal to the original inputStr). This also means if the SlingUri contains escape sequences (e.g. %20), it should keep them, if escape sequences are unescaped already this is also fine when using the builder (when using parse() this can lead to invalid URIs, best effort parsing shall be used for those cases).