When to use encodeURI versus encodeURIComponent ?
Posted on 2004-09-22
I have read that for proper Unicode support (internationalisation), you need to use encodeURI / encodeURIComponent and decodeURI / decodeURIComponent instead of escape and unescape.
Can somebody please tell me when to use encodeURI as opposed to encodeURIComponent (and decodeURI as opposed to decodeURIComponent) ? In which all cases are you supposed to use each of them ?