Is there a way to automatically encode urls?

I had the same problem encoding search queries from a data file doing requests in the request runner.

*** Data file ***
β€œq”,
β€œδ½ ε₯½β€,

*** Pre request ***
let encoded = encodeURIComponent(data.q);
pm.environment.set(β€˜query’, encoded);

*** reqeuest URL ***
/api/v1/word/{{query}}

Hope this helps!