javaapache-commonsurl-encodingapache-commons-codec

why apache-commons lib encoding space as + not as %20?


i'm using URLCodec from Apache Commons Codec to encode URL, but it encode space as + NOT as %20

why? and what is the solution?


Solution

  • See this related question

    Of course, you can always do url.replace("+", "%20"); if you need it (after encoding)