Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
Copied link with encoded space %20 gets encoded second time. How to avoid this?

There is a link eg. http://localhost:4200/test/test%20link, where %20 is encoded space. When I copy this link and try to open in new tab, the %20 will switch to %2025. How to avoid this issue?

openWindow() {
  const link = 'test link';
  window.open(
    `https://window-open-with-angular.stackblitz.io/${link}`,
    'Independent Window',
  this.windowFeatures.join()
);

Case scenario: Somebody sents a link, in which is encoded space. When receiver tries to open the link, it crashes due to unwanted encoding.

Here is an example

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

The space character is encoded as %20 and the % character is encoded as %25.

The way you get %2520 is when the url already has a %20 in it get encoded again to produce %2520

If you copy-paste http://localhost:4200/test/test link you would only get %20, as wanted.

If you copy-paste http://localhost:4200/test/test%20link you would get %2520.

Do not encode your link twice when it is already encoded. Send your link with the raw spaces.

about 4 years ago · Juan Pablo Isaza Report

0

Answer above does not answer the issue.

What was the issue, which caused double encoding? At the top of the appplication was made routing with Angular Router, which was encoding url while logging user.

How the problem was solved? A method called decodeURIComponent() was used to solve the problem.

router.navigate(urlPath) -> router.navigate(decodeURIComponent(urlPath)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!