Skip to content

Instantly share code, notes, and snippets.

@leodutra
Last active Aug 29, 2015
Embed
What would you like to do?
Fully Encode URI/URL
function fullEncodeURI(str) {
if (str !== undefined && str !== null) {
str = '' + str;
var res = '';
for(var i = 0, l = str.length; i < l ;) {
res += '%';
res += str.charCodeAt(i++).toString('16');
}
return res;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment