MCPcopy Create free account
hub / github.com/ampproject/amphtml / encodeOne

Function encodeOne

third_party/caja/html-sanitizer.js:105–109  ·  view source on GitHub ↗

converts a character in [\01-\177] to its url encoded equivalent.

(ch)

Source from the content-addressed store, hash-verified

103};
104/** converts a character in [\01-\177] to its url encoded equivalent. */
105function encodeOne(ch) {
106 var n = ch.charCodeAt(0);
107 return '%' + '0123456789ABCDEF'.charAt((n >> 4) & 0xf) +
108 '0123456789ABCDEF'.charAt(n & 0xf);
109}
110
111/**
112 * {@updoc

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected