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 7834533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:14:18+00:00 2026-06-02T13:14:18+00:00

I am trying to find a solution to this the whole evening now… I

  • 0

I am trying to find a solution to this the whole evening now…

I write an app which requests data from a web server. The Server answers in JSON format.
Everything works well except when I enter a umlaut like ä into my App.

In the following I assume the request URL is http://example.com/?q= and I am searching for “Jäger”

The correct call would then be h++p://example.com/?q=J%C3%A4ger
(Sorry for plus-signs but the spam protection doesnt let me post it correctly.)

So my problem is now:

When I give my URL String encoded or unencoded over to HttpGet it will always result in a doublee-encoded URL.

The Request to my Server is then http://example.com/?q=J%25C3%25A4ger (It encodes the percent signs)
which leads to the server searching in database for J%C3%A4ger what is obviously wrong.

So my question is how can I achive that if the user enters “Jäger” my app calls the correctly encoded URL?

Thanks for any help!

Here is the currently used code… Ist probably the worst possible idea I had…

URI url = new URI("http", "//example.com/?q=" + ((EditText)findViewById(R.id.input)).getText().toString(), null);
Log.v("MyLogTag", "API Request: " +  url);
HttpGet httpGetRequest = new HttpGet(url);

// Execute the request in the client
HttpResponse httpResponse;
httpResponse = defaultClient.execute(httpGetRequest);
  • 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-02T13:14:19+00:00Added an answer on June 2, 2026 at 1:14 pm

    Update: Sorry, HttpParams isn’t meant for request parameters but for configuring HttpClient.

    On Android, you might want to use Uri.Builder, like suggested in this other SO answer:

    Uri uri = new Uri.Builder()
        .scheme("http")
        .authority("example.com")
        .path("someservlet")
        .appendQueryParameter("param1", foo)
        .appendQueryParameter("param2", bar)
        .build();
    
    HttpGet request = new HttpGet(uri.toString());
    
    // This looks very tempting but does NOT set request parameters
    // but just HttpClient configuration parameters:
    // HttpParams params = new BasicHttpParams();
    // params.setParameter("q", query);
    // request.setParams(params);
    
    HttpResponse response = defaultClient.execute(request);
    String json = EntityUtils.toString(response.getEntity());
    

    Outside of Android, your best bet is building the query string manually (with all the encoding hassles) or finding something similar to Android’s Uri.Builder.


    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spent almost the whole day trying to find a solution to this
I have been trying to find a solution to this one but could not
I have searched around Google and StackOverflow trying to find a solution to this,
I'm having troubles trying to find a solution, if any, to this: public class
I searched around and couldn't find a solution to this problem. I am trying
Hi the whole day I've been trying to find a solution. I have tried
I am trying to find a solution to prevent race conditions in my application
I was trying to find a solution but did not succeed even if it
I'm trying to find a solution to add HTTP digest auth to a site
I am trying to find a solution that will resolve a recurring deadlock situation

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.