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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:12:52+00:00 2026-05-30T17:12:52+00:00

I have created a small test page using Sencha Touch , OpenLayers and I

  • 0

I have created a small test page using Sencha Touch, OpenLayers and I am recieving WMS/WFS data from a GeoServer.

I have set the encoding on my HTML page to UTF-8:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

I pull some WFS data from my GeoServer using the following statement:

var post = new OpenLayers.Request.POST({
    url: 'dataprovider.ashx',
    data: ...,
    headers: {
        "Content-Type": "text/xml;charset=utf-8"
    },
    callback: function (response) {
        ...
    },
});

Which I believe should give me the requested data encoded as UTF-8.

Using an IPhone 4 (IOS 4) and a Samsung Galaxy Tab 10.1 (Android 3.1) it works just fine.

My problem is: Using a device with Android 2.2, I get data back in a different encoding.

One of the words I expect to recieve is Høj, but I recieve Høj (ANSI).

Using FireFox and Chrome I know how to debug the response from the GeoServer, but I don’t know how to debug the phones or tablets.

Why is the encoding wrong on Android 2.2?

UPDATED: The problem seems to be related to devices using Android 2.2. A HTC Legend, a Samsung Galaxy SII and a Samsung Galaxy Tab 7 is having the problem – all running Android 2.2.

  • 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-30T17:12:54+00:00Added an answer on May 30, 2026 at 5:12 pm

    I have faced exactly the same problem using GeoServer, openLayers, and Android browser (Android 2.2).

    I made some research looking for place where the problem exist. All in all I went down to XMLHttpRequest.js. In this file openLayers is creating XMLHttpRequest object making request and receiving response. I have found also that in this stage already received data has encoding problem.

    I have also sniffed communication using wireshark to assure that data I am sending is in correct encoding (utf-8). I dumped this data and figured out that it was correct utf-8 data.
    But what was interesting that when I tried display my utf-8 data using iso-8859-1 I received exactly the same output as in Android browser.

    My conclusion:
    In android 2.2 web browser XMLHttpRequest object is always reading data assuming iso-8859-1 encoding.

    My solution:
    You have to fix string yourself. First you have to made map where you have to memorize that for instance “ø” is “ø”. And then by examining character by character when you find “ø” sequence substitute it by “ø”. This is example code:

    goodString = "";
    for( i = 0; i < wrongString.length; i++) {
        var w = wrongString.charCodeAt(i);
        var c = wrongString.charAt(i);
        if(w == "Ã".charCodeAt(0) {
            w2 = wrongString.charCodeAt(++i);
            if(w2 == "¸".charCodeAt(0))
                c = 'ø';
        }
        goodString += c;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a small test for updating table using Linq-to-SQL DataContext as follows:
I have created a small application using Microsoft .NET. I don't have problems with
I have created a few small flash widgets that stream .mp3 audio from an
Have small web page at www.peterbio.com/mom/test.htm Someone wrote the code with mouse over and
I have created small test web application which makes use of LINQ to SQL.
I have created a small Java application to automatically test some expressions for a
I have created a small test app. It creates a new company and a
I have created a small server for communication using node.js and socket io Server:
I have created a small flash CS4 project that has a few custom components
I have created a small application which opens,reads and creates Excel files. The app

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.