Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7781675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:18:16+00:00 2026-06-01T19:18:16+00:00

I have encoded my string(Say String a=123+gtyt) using URLEncoder class.The encoded string is String

  • 0

I have encoded my string(Say String a=”123+gtyt”) using URLEncoder class.The encoded string is String b. Then I am sending “String b” as a parameter appended to a URL. Lets say to http://example.com?request=b.

When I Decode the String at example.com using URLDecoder,The symbol + in my String is missing and I am not getting “String a” after decoding

Now When I print without decoding the “String b” at example.com.I get String a exactly.

So my doubt is whether the decoding is done by browser itself while redirecting?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:18:18+00:00Added an answer on June 1, 2026 at 7:18 pm

    When you encode “123+gtyt” – it encodes the plus sign.

    When you handle an HTTP request, servlet API automaticaly decodes it to “123+gtyt”. If you decode it once again – it changes the “+” to a space.

    So the key is – do not decode parameters explicitly.

    For example:

        final String encoded = URLEncoder.encode("123+gtyt");
        final String decoded = URLDecoder.decode(encoded);
        System.out.println("decoded = " + decoded); // 123+gtyt
        System.out.println("URLDecoder.decode(decoded) = " 
                  + URLDecoder.decode(decoded)); // prints 123 gtyt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have the following line in a method: String encodedString = URLEncoder.encode(foo, utf-8);
I have a unicode string that was encoded on the client side using JS
I have a Unicode string encoded, say, as UTF8 . One string in Unicode
I have a Base64 encoded String that contains PDF data. Using the EncdDecd unit
I have a char* string that I have encoded using AES encryption. This string
Let's say for example i have URL containing the following percent encoded character :
Let's say you have the following code: string encoded=9,8,5,4,9; // Parse the encoded string
I have a string returned from server with encoded HTML tags. I use the
I have a common class say for eg Class A which extends AsyncTask and
Possible Duplicate: error when uploading string with special characters I have a string say

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.