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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:56:46+00:00 2026-06-02T08:56:46+00:00

Please help me… here is the detail scenario.. I have an xml file containing

  • 0

Please help me…

here is the detail scenario..

I have an xml file containing xml tags e.g.

data.xml - following its content
-----------------
<data>
<node1>some text</node1>
</data>
-------------------

Now I uploaded this file to my translations service.
my code loads the file… following is the php code

$dom = new DOMDocument('1.0', 'utf-8');
if ( !$dom->load($target_file) ) {
   echo "Cannot load file $target_file";  
   exit;
}

then my logic operates and replaces the node value with some accented characters e.g. nënë and it works fine and finally i save the file

$dom->save($target_file);

Now the output should be like as follow

data.xml - following its content
-----------------
<?xml version="1.0" encoding="utf-8"?>
<data>
<node1>nënë</node1>
</data>
-------------------

BUT When i open the file the output as follow

-------------------
<?xml version="1.0"?>
<data>
<node1>n&#xEB;n&#xEB;</node1>
</data>
-------------------

please Help me … How should I make sure that xml file encoding should be UTF-8?????

Waiting……

  • 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-02T08:56:47+00:00Added an answer on June 2, 2026 at 8:56 am

    Don’t know if you already solved it or not:

    If your data is UTF-8-encoded and you discover that saveXML() turned all non-ASCII characters into numeric entities (e.g. ä -> &#xF6;):

    Chances are that the XML declaration has been missing when you loaded the source data. Try adding <?xml version=”1.0″ encoding=”UTF-8″?> to the beginning of the document before you read it with load() or loadXML(). Then the non-ASCII characters should remain untouched. Worked for me.

    Source: http://www.php.net/manual/en/domdocument.savexml.php#97434

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

Sidebar

Related Questions

Please help. I have the following - ListView and its two handlers AdminUsersListView_ItemEditing, AdminUsersListView_Load.
Please help me decode the following. I have a problem in the network, unable
please help i have the following php code for my login session but i
Please help! I need to produce a Crystal Report with multiple data columns, but
Please help me figure a single query that will transform the data below... |id
Please help I am getting the following error when I am binding the drop
Please help me out with an algorithm for the following problem - Given a
Please help me about this issue... In my application i have calender where user
Please Help me to do this first i have this div <div class=loader alt=stat.php>
Please help me with the following implementation of Counting Sort in Java. I am

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.