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

  • Home
  • SEARCH
  • 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 7747227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:28:38+00:00 2026-06-01T10:28:38+00:00

I need your help with this one again. I want to send special characters

  • 0

I need your help with this one again. I want to send special characters from an Android application to a PHP script and vice versa.

Android Code


...
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://www.mypage.com/script.php");
try {
    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
    nameValuePairs.add(new BasicNameValuePair("value", "Español"));
    post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
    HttpResponse response = client.execute(post);
    StatusLine statusLine = response.getStatusLine();
    if(statusLine.getStatusCode() == HttpURLConnection.HTTP_OK){
        InputStream inps = response.getEntity().getContent();
        InputStreamReader inp = new InputStreamReader(inps, Charset.forName("ISO-8859-2"));
        BufferedReader rd = new BufferedReader(inp);
        StringBuilder stringBuilder = new StringBuilder();
        String bufferedStrChunk = null;
        while ((bufferedStrChunk = rd.readLine()) != null) {
            stringBuilder.append(bufferedStrChunk);
        }
        Result = stringBuilder.toString();
    }...

PHP Code


<?php
    header("Content-Type: text/plain;charset=ISO-8859-2");
    echo $_POST["value"];
?>

First move

I am trying to send the string “Español” from Android to PHP. I store the string into a MySQL table (UNICODE charset) and I get the string correctly. I also get the integer values of each charracter. The result is “Español” and “69.115.112.97.241.111.108”. So, Android sends the character “ñ” as 241, which in the UNICODE Chart is defined as “ń”. See it at http://www.ssec.wisc.edu/~tomw/java/unicode.html#x0080

Second move

I return the string from PHP to Android and instead of getting “ñ” I get “ń”. Here is where I am lost. When does this change and why having the same numeric value they are different? This is too much for me and I request your help. 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-06-01T10:28:40+00:00Added an answer on June 1, 2026 at 10:28 am

    Use ISO-8859-2 when you create the URLEncodedEntity that you send off. You can set this as a parameter in the constructor.

    Without a specified charset, you are probably sending the data in UTF-8/UTF-16 (most common) which the server is interpreting in a different way.

    EDIT: It looks like ISO-8859-2 doesn’t support ñ. You may have to change something server-side. http://en.wikipedia.org/wiki/ISO/IEC_8859-2

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

Sidebar

Related Questions

I need your help again. This should be a function for php. I've got
i need your help on this one. lets say: public class myProduct { public
I really need your help for this. I am relatively new to programming and
I need your help to translate a query into pyes. This query is working
ive being trying to cope with this problem but still. I need your help.
I need your help to define a special case in XML schema: A sequence
I need your help again :) I'm trying to do a plugin with jQuery
I need your help. I'm trying to install php_apc.dll into my php directory. So
I need your help and please give me some advice. From programming pearls I
i need your help about this issue badly. i am trying to model a

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.