MCPcopy Create free account
hub / github.com/M66B/FairEmail / encode

Method encode

app/src/main/java/javax/mail/URLName.java:563–573  ·  view source on GitHub ↗

Translates a string into x-www-form-urlencoded format. @param s String to be translated. @return the translated String .

(String s)

Source from the content-addressed store, hash-verified

561 * @return the translated <code>String</code>.
562 */
563 static String encode(String s) {
564 if (s == null)
565 return null;
566 // the common case is no encoding is needed
567 for (int i = 0; i < s.length(); i++) {
568 int c = (int)s.charAt(i);
569 if (c == ' ' || !dontNeedEncoding.get(c))
570 return _encode(s);
571 }
572 return s;
573 }
574
575 private static String _encode(String s) {
576 int maxBytesPerChar = 10;

Callers 1

URLNameMethod · 0.95

Calls 4

_encodeMethod · 0.95
charAtMethod · 0.80
lengthMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected