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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:44:34+00:00 2026-06-15T05:44:34+00:00

I want to send a POST request from android to a PHP application in

  • 0

I want to send a POST request from android to a PHP application in utf-8 with the below code:

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair(Site.SQL_QUERY, "just a test 東京"));

UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(params);
urlEncodedFormEntity.setContentEncoding(HTTP.UTF_8);
httppost.setEntity(urlEncodedFormEntity);

HttpResponse response = httpclient.execute(httppost);
BufferedReader reader = new BufferedReader(new inputStreamReader(response.getEntity().getContent(), HTTP.UTF_8));
String result = reader.readLine();

I set encoding to UTF-8, but Japanese characters contained in the string are not displayed normally.

Here is my PHP code(cakePHP). I just dump parameter.

function sqlQuery(){
   var_dump($this->params['form']['sql_query']);exit;
}

It will display something like “just a test □□”

I have also tried with

mb_convert_encoding ($this->params['form']['sql_query'],"UTF-8")

But problem persists…

Someone can help me ?
Thank you

  • 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-15T05:44:35+00:00Added an answer on June 15, 2026 at 5:44 am

    This has been the problem Sending UTF-8 data from Android. Your code would work fine except that you will have to encode your String to Base64 . At Server PHP you just decode Base64 String back. It worked for me. I can share if you need the code.

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

Sidebar

Related Questions

I want to send posts from Android to Facebook wall. Some initial code works
There is way to send HTTP post request from my Controller? I want to
So all I want to do is send a POST request to a url.
I want to send the post data from an input like this: <input type=file
Hello Sir i want send list of data to php server i use following
Want to send the text from my current vb application to the Active Window
I want to send some information from PHP to Java. Why? Because I have
I want to make a POST request to my Controller with jquery. function Send()
how can I handle post request in python script? Somewhere I want to send
I am in my Terminal and I want to send a POST request to

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.