0

I want to make routes like posts/postName but i ran into this thin when i use some special characters like í,á,é it throw at me somethink like this posts/%C3%A1 and i couldn't find solution.

This is code that i use:

 router.get('/:id', (req, res) => {
       post = req.url;
       post = topic.split('/')[1];
       res.render('post', {name: post});
       console.log(post);
 });

And it gives me output like this with input 'á'

%C3%A1

Komiš
  • 23
  • 5
  • Have you considered stripping out diacritics and then just using ASCII string instead? https://stackoverflow.com/questions/286921/efficiently-replace-all-accented-characters-in-a-string – Terry Oct 08 '22 at 11:40
  • @Terry Sadly it doesn't work but maybe I'm doing something wrong. – Komiš Oct 08 '22 at 12:07

0 Answers0