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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:17:53+00:00 2026-05-23T06:17:53+00:00

So I have a small PHP script that generates an xml feel for the

  • 0

So I have a small PHP script that generates an xml feel for the rss feed of my blog. However, it throws up this error:

This page contains the following errors:

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

(seen here: http://aviatex14.co.uk/rss.xml)

Here’s the code that generates it:

while ($line = mysql_fetch_array($result)) {
  $return[] = $line;
  var_dump(date("Y-m-d H:i:s", $line['timestamp']));
}

$now = date("D, d M Y H:i:s T");

$output = "<?xml version=\"1.0\" encoding=\"UTF-16\" ?>
             <rss version=\"2.0\">
                <channel>
                  <title></title>
                  <link></link>
                  <description></description>
                  <pubDate></pubDate>
                  <language>en-us</language>
                    
                  <lastBuildDate>$now</lastBuildDate>
          ";
            
foreach ($return as $line) {
  $output .= "<item><title>".htmlentities($line['title'])."</title>
                <link>http://blog.aviatex14.co.uk/permalink.php?uid=".htmlentities($line['uid'])."</link>     
                <description>".htmlentities(strip_tags($line['entry']))."</description>
                <pubDate>".$date = date("Y-m-d H:i:s T", $line['timestamp'])."</pubDate> 
              </item>";
}
$output .= "</channel></rss>";
print "Content-Type: application/rss+xml";
echo $output;

$f = fopen("rss.xml", "w"); 
fwrite($f, $output); 
fclose($f); 

Any help would be appreciated! 😀

  • 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-23T06:17:54+00:00Added an answer on May 23, 2026 at 6:17 am

    It says "TOKYO � A Japanese" at that line (and further down in the feed as well). The � is not utf-8. Try to utf8_encode (or iconv if you want a different encoding) the content or even better: use an XML processor to create the feed.

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

Sidebar

Related Questions

I have a small PHP script that is selecting a random sentence from an
I have this small PHP script: <?php session_start(); $var = array(); $var['key'] = 'Var
I have this small jquery script that does not work if I remove the
I have a small PHP script that takes the values from a dropdown list
I have a small problem with a script that reads an XML file and
I have a small issue on a search form. PLease check this: http://www.fortisfitness.ca/test/script.php What's
I have a small AJAX application, written in PHP that I did not secure
I have a script that generates a csv file using the following code: header('Content-type:
I have PHP application that contain three small applications. Each application have own users
I have a small ajax application built with php. Using phpMyAdmin I have set

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.