1function rawurlencode(str) { 2 // discuss at: http://phpjs.org/functions/rawurlencode/ 3 // original by: Brett Zamir (http://brett-zamir.me) 4 // input by: travc 5 // input by: Brett Zamir (http://brett-zamir.me) 6 // input by: Michael Grier 7 // input by: Ratheous 8 // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 9 // bugfixed by: Brett Zamir (http://brett-zamir.me) 10 // bugfixed by: Joris 11 // reimplemented by: Brett Zamir (http://brett-zamir.me) 12 // reimplemented by: Brett Zamir (http://brett-zamir.me) 13 // note: This reflects PHP 5.3/6.0+ behavior 14 // note: Please be aware that this function expects to encode 15 // into UTF-8 encoded strings, as found on 16 // note: pages served as UTF-8 17 // example 1: rawurlencode('Kevin van Zonneveld!'); 18 // returns 1: 'Kevin%20van%20Zonneveld%21' 19 // example 2: rawurlencode('http://kevin.vanzonneveld.net/'); 20 // returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F' 21 // example 3: 22 // rawurlencode('http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a'); 23 // returns 3: 24 // 'http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a' 25 26 str = (str + '') 27 .toString(); 28 29 // Tilde should be allowed unescaped in future versions of PHP (as 30 // reflected below), but if you want to reflect current 31 // PHP behavior, you would need to add ".replace(/~/g, '%7E');" to the 32 // following. 33 return encodeURIComponent(str) 34 .replace(/!/g, '%21') 35 .replace(/'/g, '%27') 36 .replace(/\(/g, '%28') 37 .replace(/\)/g, '%29') 38 .replace(/\*/g, '%2A'); 39}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.