I am trying to encode a string like BNg{L3
using encodeURI()
but the result I get is this:
BNg%7B%E2%80%8B%E2%80%8BL3
Of course, I would like BNg%7BL3
I found that the sequence %E2%80%8B
is ZERO WIDTH SPACE but it’s not in the provided string (I get the string from a query’s body, this problem shows up server-side). What does cause this behaviour? And more importantly, how do I get what I want?