Added encodeURIComponent support