MCPcopy Create free account
hub / github.com/davidgiven/luje / encodeOthers

Method encodeOthers

lib/java/net/URI.java:1588–1600  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

1586 * component s @return java.lang.String the converted string
1587 */
1588 private String encodeOthers(String s) {
1589 try {
1590 /*
1591 * Use a different encoder than URLEncoder since: 1. chars like "/",
1592 * "#", "@" etc needs to be preserved instead of being encoded, 2.
1593 * UTF-8 char set needs to be used for encoding instead of default
1594 * platform one 3. Only other chars need to be converted
1595 */
1596 return URIEncoderDecoder.encodeOthers(s);
1597 } catch (UnsupportedEncodingException e) {
1598 throw new RuntimeException(e.toString());
1599 }
1600 }
1601
1602 private String decode(String s) {
1603 if (s == null) {

Callers 1

toASCIIStringMethod · 0.95

Calls 2

encodeOthersMethod · 0.95
toStringMethod · 0.65

Tested by

no test coverage detected