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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:35:35+00:00 2026-05-31T14:35:35+00:00

I have build an android app that let’s you post your name on a

  • 0

I have build an android app that let’s you post your name on a website though i form that sends a http POST request to the website. The problem is that 90% av my customers are Swedish and the POST request seems to chop of everything after a special character in a string, including the special character itself.

So the Swedish surname “Börjesson”, becomes “B”.

my POST request code:

public static String execRequest(String url, Map<String, String> params)
{
    try {
        DefaultHttpClient defaultHttpClient = new DefaultHttpClient();
        HttpPost httpPost = null;
        HttpGet httpGet = null;
        if(params == null || params.size() == 0) {
            httpGet = new HttpGet(url);
            httpGet.setHeader("Accept-Encoding", "UTF-8");
        }
        else {
            httpPost = new HttpPost(url);
            httpPost.setHeader("Accept-Encoding", "UTF-8");
                List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
            for(String key: params.keySet()) {
                nameValuePairs.add(new BasicNameValuePair(key, params.get(key)));
            }
            httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        }
        HttpResponse httpResponse = (HttpResponse)defaultHttpClient.execute(httpPost == null ? httpGet : httpPost);
        HttpEntity httpEntity = httpResponse.getEntity();
        if(null != httpEntity) {
            InputStream inputStream = httpEntity.getContent();
            Header contentEncoding = httpResponse.getFirstHeader("Content-Encoding");
            if(contentEncoding != null && contentEncoding.getValue().equalsIgnoreCase("UTF-8")) {
                inputStream = new GZIPInputStream(inputStream);
            }
            String responseString = convertStreamToString(inputStream);
            inputStream.close();
                return responseString;
        }
    }
    catch(Throwable t) {
        t.printStackTrace();
    }
    return null;
}

So, any tips of what I’m doing wrong?

Thanks in advance!

  • 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-05-31T14:35:36+00:00Added an answer on May 31, 2026 at 2:35 pm

    Use httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "utf-8"));

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

Sidebar

Related Questions

I want to build an notepad-style application on android that will have syntax highlighting.
I am trying to build an app that accesses the sms on android os.
I am planing to build an android app, which will have user posted content
I have the following problem. We have build an app with mono for android.
I have an existing app that has a minimum android:minSdkVersion of Android 2.1 I
I have an android app that listens for json commands over a socket. I
I am using ANT to compile an Android app that I have built. It
I have been asked to build a rather simple form processor application that interacts
I have run my android app against the new build target provided by the
I have build C# program that work with RAPI (communication to PPC or WinCE)

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.