Alternatives to encodeURI and encodeURIComponent to replace escape

386 Views Asked by At

I am posting data to a site that often includes French characters. This site has a form which handles the French characters fine but I had trouble when sending doing this inside a node program.

An example would be a field with the name: "Maevà". When I look at the dev tools in chrome I can see that the request encodes this name as: Maev%E0.

This works fine and in my code if I use escape(Maevà) it returns Maev%E0 which works perfectly.

Unfortunately escape is deprecated so I tried to use encodeURIComponent and encodeURI but they both return Maev%C3%A0 which does not work.

Is there something else I can use?

0

There are 0 best solutions below