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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:33:37+00:00 2026-05-20T08:33:37+00:00

I am using simpleXML in PHP to fetch xml file. The thing is that

  • 0

I am using simpleXML in PHP to fetch xml file.
The thing is that xml file’s encoding is not in utf-8. It is in euc-kr.

<?xml version="1.0" encoding="euc-kr" ?> 

So, if I used the simpleXML to fetch the data, the text which is not in english, just crash. (but it correctly prints structures and everything…its just that text in Korean crash)
Is there anyway that I can set encoding for simpleXML?

OR is there anyway that I can change the xml file to encoding with utf-8??

I just tried using str_replace(‘euc-kr’,’utf-8′,$data) to change the words, but that does not seem to change the original file types. Because it causes an error like

Input is not proper UTF-8, indicate encoding ! Bytes: 0xB0 0xB3 0xC6 0xF7

How can I resolve this problem? By the way, I have no permission to change the contents of the xml file

  • 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-20T08:33:38+00:00Added an answer on May 20, 2026 at 8:33 am

    Assuming that you want to get the same charset out, I would use DomDocument. But if you want simplexml, you could load it through DomDocument then convert to simplexml:

    $dom = new DomDocument('1.0', 'euc-kr');
    $dom->load('file.xml'); // or loadXml($string);
    $simple = simplexml_import_dom($dom->documentElement);
    

    Then when you’re done, just $dom->save($filename);…

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

Sidebar

Related Questions

I'm using XML for a config file in PHP (Using SimpleXML), in creating the
I'm using SimpleXML to load and parse an XML document with PHP. I'm not
I'm trying to parse a moderately large XML file (6mb) in php using simpleXML.
I have a XML document that looks something like this: <?xml version=1.0 encoding=UTF-8?> <citizen>
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I am parsing an xml file using php simplexml_load_file() and then inserting the desired
Hi Im trying to parse an xml feed using simplexml in php. The xml
I have an XML document that looks like this: <Data xmlns=http://www.domain.com/schema/data xmlns:dmd=http://www.domain.com/schema/data-metadata > <Something>...</Something>
I am parsing an XML file with PHP and inserting the rows in a
I have a php function that fetches and returns tweets data from twitter as

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.