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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:56:20+00:00 2026-05-23T09:56:20+00:00

I am retrieving the nearest locations available from a given address (Longitude/Latitude) from geolocation

  • 0

I am retrieving the nearest locations available from a given address (Longitude/Latitude) from geolocation website.
It works fine, but for some places it gives junk characters in the name. Moreover, in browser I am getting different characters compared to my PHP CURL functionality.
Here is the URL

http://www.geoplugin.net/extras/nearby.gp?lat=17.7374669&long=83.3214858&limit=5&radius=50&format=php

One of the location is “Sitammapeta” in original location name, but in browser I am getting “Sītammapeta” where as in CURL function I am getting “SÄ«tammapeta”.

Please tell me why this difference. I wrote a function to convert browser output to original which works fine.

function convert ($old)
    {
        $n="";
        for ($i=0; $i<strlen($old); $i++)
        {
            $n .= chr(ord(substr($old,$i,1)));
        }
        return $n;
    }

But I dont understand how I convert the CURL output to original name.

EDIT
CURL code

$ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $host);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_USERAGENT, 'geoPlugin PHP Class v1.0');
            $response = curl_exec($ch);
            curl_close ($ch);
  • 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-23T09:56:21+00:00Added an answer on May 23, 2026 at 9:56 am

    The problem is that you’re displaying the data in your web-browser, that the data your sending is UTF-8 encoded and that your browser has no idea about that. If you add <meta charset="utf-8" /> or <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> to the head of your HTML document, that should solve your problem.

    Without the charset defined as UTF-8:

    Without

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

    With

    Alternatively, you could have your PHP script send a content-type header using header('Content-Type:text/html; charset=utf-8'); (or replace text/html with text/plain if you want to use plain text).

    Reference:

    According to RFC2616 Section 3.7.1:

    When no explicit charset parameter is
    provided by the sender, media subtypes
    of the “text” type are defined to have
    a default charset value of
    “ISO-8859-1” when received via HTTP.

    That means that if you don’t specify a charset, ISO-8859-1 will (should) be used, and as such, some characters won’t be displayed properly if the data is UTF-8 encoded.

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

Sidebar

Related Questions

Retrieving data from the REST Server works well, but if I want to post
This works great at retrieving the php data for say 15 passes BUT when
When retrieving a lookup code value from a table, some folks do this... Dim
I am retrieving some data from the server which looks something like this: 1:some
For retrieving image from blobstore, I usually do the following and it works: <img
I am retrieving some configuration from a service and passing this data to the
when retrieving and caching/saving (in a database) some posts from an rss feed, how
I am retrieving an XML string through a URL. My code works great, but
I am retrieving 3 fields from a database, and by default, only the username
We have a flash retrieving information from an XML file. Right now we are

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.