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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:51:52+00:00 2026-06-17T23:51:52+00:00

I am developing an application in which I am getting data from web service

  • 0

I am developing an application in which I am getting data from web service and displaying in the Android mobile. But the problem is while getting Turkish data it is not displaying correctly.

I already set utf-8 in PHP. But still getting special character symbols like A?ık ?&#287 for the string Açık Öğretim.

Here is my PHP code:

<?php
include("Netbrut_class.php");
header('Content-type: text/xml; charset: utf-8');

    $webservice = new Netbrut;

    $content='<?xml version="1.0" encoding="utf-8"?><salary_comparision>';

    $education = $webservice->select_education();

    for($i=0; $i<count($education); $i++){

        $string = html_entity_decode($education[$i]['comparision_name'], ENT_QUOTES, "utf-8");
        $content.="<education id='".$education[$i]['id']."'>".$string."</education>";
    }

    $content .='</salary_comparision>';

echo $content;
?>

And my Java code is / Here I am writing java code just for testing:

public class testing {

    static String[] attributes;

    public static void main(String[] args)
    {
        URL url;
        try {
            url = new URL("http://192.168.1.106/netBrut/webservices/testing.php");

        HttpURLConnection  connection = (HttpURLConnection) url.openConnection();
        connection = (HttpURLConnection) url.openConnection();
        java.io.InputStream is  = connection.getInputStream();

        InputStreamReader reader = new InputStreamReader(is, "utf-8");


        StringWriter sw = new StringWriter();

        char [] buffer = new char[1024 * 8];
        int count ;

        while( (count = reader.read(buffer)) != -1){
          sw.write(buffer, 0, count);
        }

        System.out.println(sw.toString());
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
      }
}

And returning XML from web service is:

<?xml version="1.0" encoding="utf-8"?>
<salary_comparision>
    <education id='128'>A?&#305;k ?&#287;retim</education>//Check here
    <education id='5'>Doktora</education>
    <education id='3'>Master</education>
    <education id='4'>MBA</education>
    <education id='2'>?niversite</education>
</salary_comparision>
  • 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-17T23:51:53+00:00Added an answer on June 17, 2026 at 11:51 pm

    In the Php code just change the below lines

     $string = html_entity_decode($education[$i]['comparision_name'], ENT_QUOTES, "utf-8");
     $content.="<education id='".$education[$i]['id']."'>".$string."</education>";
    

    to

    $string = $webservice->unhtmlspecialchars($education[$i]['comparision_name']);
    $content.="<education id='".$education[$i]['id']."'>".$string."</education>";
    

    See htmlspecialchars­Docs.

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

Sidebar

Related Questions

Im developing ios application which is getting data from the web server. I want
I am developing application which is having Gujarati font in text-view but my problem
I`m developing an application which receives data from my GPS device like coordinates, speed
I am developing an application in which I am getting a XML file from
I am developing a application which receives 600-700 KB of XML data from the
I am developing an application, in which I am getting the values from the
I'm developing an application which loads lots of data (like from csv). I'm creating
I am developing an android application in which I have to upload image from
I'm developing an application which queries data from the host, and then inserts them
Okay, I am developing an Application which requires getting sensitive information from a database

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.