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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:28:54+00:00 2026-06-04T04:28:54+00:00

I am having an issue with an XML file that I am generating from

  • 0

I am having an issue with an XML file that I am generating from data from my database.

I am specifying an encoding type of UTF-8.

I have some text that when I view it in a browser, or in the database appears to represent a é character. However, when I view the XML file in Notepad++ it shows as [xE9].

This is the definition at the top of my XML file:

<?xml version="1.0" encoding="UTF-8" ?>
<rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0">

This is an excerpt from my XML file and shows the character that is causing issues. I’m confused as to why this shows as non-UTF-8 character as it does below, but this is the reason why my XML is not valid.

<description><![CDATA[work appliqu顤ress. Picco three-quarter sleeved style. Cutwork appliqu顦eatures fitted, with side pockets.]]></description>

In my PHP script I am using the htmlspecialchars function, but it doesn’t appear to deal with this character:

<description><![CDATA[<?php echo htmlspecialchars($product['product-description']) ?: 'CRMPicco Online'; ?>]]></description>

Unfortunately, there are a number of instances in the file where this character is present so I can’t just remove that one character from the database.

Should I be able to clean this up in PHP?

  • 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-04T04:28:54+00:00Added an answer on June 4, 2026 at 4:28 am

    This can be done using the iconv function in PHP:

    $text = iconv("UTF-8","UTF-8//IGNORE",$text);
    

    I have changed the code to use this, and it works.

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

Sidebar

Related Questions

I'm having a bit o' trouble... Here is my mappings.xml file... <?xml version=1.0 encoding=utf-8?>
I am having an issue serializing a c# class to an XML file that
I'm having a real issue trying to parse an XML file that is structured
I'm doing an iPhone app that reads data from XML file, turn them into
I'm having an issue where I'm getting an XML file, and from the samples
I'm having an issue getting a LINQ query to work. I have this XML:
Having an issue here that I have tried everything I can think of but
I have a PHP file which produces an Xml sitemap based on data which
I'm having a bit of an issue. I'm parsing a large xml file using
I'm having an issue passing a variable to a builder file for xml generation,

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.