Skip to content
Advertisement

Replacing URL Character Encodings in Java

I am trying to replace character encodings in URL’s to no avail, I have scouted around the internet but have only found outdated libraries and answers.

JavaScript

For example, https://fonts.googleapis.com/css?family=Noto+Serif%3A400%2C400i%2C700%2C700i&ver=5.3.4 would become https://fonts.googleapis.com/css?family=Noto+Serif:400,400i,700,700i&ver=5.3.4

The code shown above works, but there must be a more concise way of doing this, right? That’s the question

Advertisement

Answer

Actually, you can use java.net.URLDecoder

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement