Java – URL encoding / decoding replacement space on file name, which needs to be replaced
•
Java
My product is a web application
Solution
You can also convert spaces to
See: URL encoding the space character: + or% 20?
There are a variety of other Java libraries for URL coding Here are two examples:
guava:
UrlEscapers.urlPathSegmentEscaper().escape(urlToEscape);
Spring framework:
UriUtils.encodePath(urlToEscape,Charsets.UTF_8.toString());
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码