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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:36:55+00:00 2026-05-16T17:36:55+00:00

Is there a way to transform a xml file which is iso-8859-1 to utf-8

  • 0

Is there a way to transform a xml file which is iso-8859-1 to utf-8 ?

  • 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-16T17:36:56+00:00Added an answer on May 16, 2026 at 5:36 pm

    The simplest way would be to load it and then save it with one of the XML APIs available. That way any extra transformations (e.g. the XML declaration) will be handled appropriately. For example:

    using System;
    using System.Text;
    using System.Xml.Linq;
    
    class Test
    {
        static void Main(string[] args)
        {
            XDocument doc = XDocument.Load("test.xml");
            XDeclaration declaration = doc.Declaration;
            if (declaration != null) {
                declaration.Encoding = "utf-8";
            }
            doc.Save("test-utf8.xml");
        }
    }
    

    Note that I think this may end up changing some things around indentation etc, unless you specify some extra options. Is that likely to be a problem for you?

    You could potentially just load the whole file as text (using Encoding.GetEncoding(28591)), modify the declaration part yourself and resave it in UTF-8 yourself. I suspect there may be some corner cases where that would cause a problem though.

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

Sidebar

Related Questions

There must be a generic way to transform some hierachical XML such as: <element1
I am wondering if there is a way to transform a matrix of 2
Is there a way to make OpenGL transform a general vector I give it
Is there a way to compute efficiently the Fourier transform of the max of
Is there a way to disable the affect of CSS like text-transform on text
I need to transform an XML file to another XML file, where the source
I have an XML file that I want to transform using an XSLT. It
I have an xml file I wish to transform using an xsl-document, but I
I have an xml file like this: <?xml version=1.0 encoding=UTF-8?> <todo> <list><item>first</item><item>second</item></list> <list><item>first</item><item>second</item></list> </todo>
I'm using HaXml to transform a XML file and it's all quite working nicely.

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.