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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:23:06+00:00 2026-06-11T15:23:06+00:00

I have no idea of what is going wrong, i was using this same

  • 0

I have no idea of what is going wrong, i was using this same script to get another XML and it was working just fine.
This is the script:

<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"LATIN-1\"?>";
echo "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">";
echo "<plist version=\"1.0\">";

function getXML($sql="SELECT IDCargo FROM database.table"){

    $conn   = mysql_connect ("myserverurl.com", "user", "psw");
    $db     = mysql_select_db("database");
    $result = mysql_query($sql, $conn);
    $column = "";
    echo "<array>";

    while($row = mysql_fetch_assoc($result)){
        $column .= "<dict>";
        foreach ($row as $key => $value){
            $column .= "<key>$key</key>";
            $column .= "<string>$value</string>";
        }
        $column .= "</dict>";
    }

    echo $column;
    echo "</array>";
    echo "</plist>";
}
getXML("SELECT IDCargo as ID_CARGO, SequencialDoCandidato as NUMERO_SEQ_CANDIDATO, NomeDoCandidato AS NOME_CANDIDATO, NumeroDoCandidato as NUMERO_CANDIDATO, NomeDoPartido AS SIGLA_PARTIDO, Estado as SIGLA_ESTADO,IDUnidadeEleitoral AS ID_CIDADE_CANDIDATO, UnidadeEleitoral AS CIDADE_CANDIDATO FROM database.table");
mysql_close();
?>

It brings this error:

This page contains the following errors:

error on line 1 at column 538: Encoding error
Below is a rendering of the page up to the first error.

ID_CARGO11NUMERO_SEQ_CANDIDATO10000002965NOME_CANDIDATOAGRECINO DE SOUSANUMERO_CANDIDATO13SIGLA_PARTIDOPTSIGLA_ESTADOACID_CIDADE_CANDIDATO1120CIDADE_CANDIDATO

Can anyone see anything? Give me some help here, please.
I got the script from one that was working just fine.

  • 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-11T15:23:07+00:00Added an answer on June 11, 2026 at 3:23 pm

    If I read your code, I can see :

    echo "<?xml version=\"1.0\" encoding=\"LATIN-1\"?>";
    

    So I guess you want to output LATIN-1 charset. You need to specify this charset everywhere :

    1/ You can try to specify the encoding on the http header :

    header("Content-type: text/xml; charset=ISO-8859-1");
    

    2/ And you can also set the charset on the DB client :

    mysql_set_charset('latin1', $db);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anyone have any idea why my jQuery carousel is working fine at the bottom
I don't have the slightest idea what's going on here, and Google provides no
Anyone have idea how to pass value from iPhone application to the REST-Webservice using
I missed my workspace in which I was working. Any one have idea about
I'm trying to get a clear idea of when I should be using indexed
I'm using PHP and xPath to crawl into a website I own (just crawl
I have implemented caching Images in my website, It is working fine in IIS
I've just started using mod_rewrite, this is what I use for a quite basic
Anyone have idea about how to bind Boolean in sqlite with objective - c.
I have idea to write errors from my application to the Windows Event Viewer

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.