Last active
March 30, 2017 18:45
-
-
Save the1sky/5c3cdde606c68c3bbf8538a935b8adf7 to your computer and use it in GitHub Desktop.
difference between encodeURI and encodeURLComponent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = []; | |
for(var i=0;i<256;i++) { | |
var char=String.fromCharCode(i); | |
if(encodeURI(char)!==encodeURIComponent(char)) { | |
arr.push({ | |
character:char, | |
encodeURI:encodeURI(char), | |
encodeURIComponent:encodeURIComponent(char) | |
}); | |
} | |
} | |
console.table(arr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment