Any way to make encodeURIComponent in JavaScript ignore certain characters?

is there a way to make the method encodeURIComponent

ignore certain characters, for example if I don't want it to encode the character £

. ?

+2


a source to share


1 answer


This is impossible without packaging it.

Probably the safest thing to do would be ... not to. If you are a thrill seeker, just undo the parts you want to decode after you finish encoding.



Something like this might be a naive way (i.e. my way):

encodeURIComponent(uri).replace('%A3','£')

      

+2


a source







All Articles