// Performance impact of this seems negligible (performance.now() diff in WebKit went from 48 to 52) // and there was a preference to let more non-ASCII hit the parser. function encodeHostEndingCodePoints(input) {
let output = ""; for (const codePoint of input) { if ([":", "/", "?", "#", "\\"].includes(codePoint)) {
output += encodeURIComponent(codePoint);
} else {
output += codePoint;
}
} return output;
}
function runTests(idnaTests) { for (const idnaTest of idnaTests) { if (typeof idnaTest === "string") { continue// skip comments
} if (idnaTest.input === "") { continue// cannot test empty string input through new URL()
} // Percent-encode the input such that ? and equivalent code points do not end up counting as // part of the URL, but are parsed through the host parser instead. const encodedInput = encodeHostEndingCodePoints(idnaTest.input);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.