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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:47:55+00:00 2026-05-26T04:47:55+00:00

In the Android application I have written, there is a portion which allows the

  • 0

In the Android application I have written, there is a portion which allows the user to enter the start and end location of their trip, and a route itinerary is returned. I am using Bing Maps REST services for this. I want the directions returned to be in French.

A sample request: request. This is best seen on a Chrome browser, Safari and Firefox take care of this. You can see that the directions have lots of strange characters where they are not supposed to be. I have tried decoding on the device, by doing:

URLDecoder.decode(obj.optString("text"), HTTP.ISO_8859_1)

which does not work (the response stays the same), which makes sense I think since it has already become the special characters. I cannot use Windows-1252 to decode because Android does not seem to support that.

An example of what I am being sent back: Léger Encombrement. What it should be: Léger Encombrement.

It works perfectly on an iPhone as well, but not on Android. Any suggestions on how I can solve this?

My code in the connection class is:

public static JSONObject getJSONResult(final String url) {

    try {
        final HttpClient client = new DefaultHttpClient();
        final HttpGet get = new HttpGet(url);
        final HttpResponse responsePost = client.execute(get);
        final HttpEntity resEntity = responsePost.getEntity();

        boolean DEBUG = true;
        if (DEBUG) {
            Log.d("", "[JSON-ENV] url:  " + url);
        }

        final String str = EntityUtils.toString(resEntity);
        Log.d("connection", "response str: " + str);

        if (resEntity != null) {
            final JSONObject obj = new JSONObject(str);
            Log.d("connection", "JSON RESPONSE IS " + obj);
            return obj;

        } else {
            return null;
        }

    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }

}

Is there something I need to add into my connection class?

UPDATE:

I added the JSON parsing code to format as “ISO_8859_1” as seen at this link: http://p-xr.com/android-tutorial-how-to-parse-read-json-data-into-a-android-listview/ but I still get the same results …

  • 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-26T04:47:55+00:00Added an answer on May 26, 2026 at 4:47 am

    This is JSON. You don’t need to use URLDecoder. The error is before that, probably when you create the String for the JSON Parser. JSON is always in UTF-8 (or 16, rarely)

    Can you post the code for reading the server response?

    edit

    EntityUtils uses ISO_8859_1 as a default Charset if it does not find one in the content. Simply change

    final String str = EntityUtils.toString(resEntity);
    

    to

    final String str = EntityUtils.toString(resEntity, HTTP.UTF_8);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a simple Android application that uses a sqlite database which is
I have written an Android Application and the generated .APK file I uploaded in
I have written an Android application that I am about to release, but I
I am developing an android application in which i have to play a mp4
I have written a simple database program in android. It runs fine, there is
I have written one simple Android Tetris application. After it I decided to read
I have an application which is mostly native code written in C: Simon Tatham's
I have written tab for my android application. My question is switching between tab
I want to create a database for my android application. I have written the
I have an Android application with version 1.6 I take the wallpaper and show

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.