MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / encodeEntities

Method encodeEntities

vm/JavaAPI/src/java/net/URIHelper.java:194–206  ·  view source on GitHub ↗

Utility method for encoding HTML entities within query parameters. @param ch @return

(String source)

Source from the content-addressed store, hash-verified

192 * @return
193 */
194 static String encodeEntities(String source) {
195 StringBuffer buffer = new StringBuffer();
196 String encoded;
197 for (int index = 0; index < source.length(); index++) {
198 char ch = source.charAt(index);
199 if ((encoded = encodeEntity(ch)) != null) {
200 buffer.append(encoded);
201 } else {
202 buffer.append(ch);
203 }
204 }
205 return buffer.toString();
206 }
207
208 /**
209 * Utility method to encode a string, as per RFC 2396 section 2. Set

Callers 1

buildQueryMethod · 0.95

Calls 5

encodeEntityMethod · 0.95
appendMethod · 0.95
toStringMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.65

Tested by

no test coverage detected