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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:41:06+00:00 2026-06-05T04:41:06+00:00

I have a SharePoint library that captures data entered by user as an XML

  • 0

I have a SharePoint library that captures data entered by user as an XML form. This form is encoded as UTF-8, but some of the characters entered by users are not ASCII (e.g. words from French, Spanish, Maori) and are not saved as UTF-8.

Here is an example of such data (abbreviated, sans meta data):

<?xml version="1.0" encoding="utf-8"?>
<my:myFields xmlns:my="http://schemas.microsoft.com/etc...">
    <my:title>Te whakaako i Te Reo Mäori -- Teaching Te Reo Mäori</my:title>

I am using the parse function in ElementTree (xml.etree.ElementTree) to compile this information into a report, which I am then exporting as CSV and sending off in an Excel spreadsheet. As such I would like to convert both the UTF-8 characters and all user input into a single format that works with Excel (cp1252?):

import xml.etree.ElementTree as ET
course = ET.parse(os.path.join(path, filename))

When I go to write the results of all my calculations to file, I get the following error (for the example XML above):

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 48: ordinal not in range(128)

When I look at the data, I see that the text from the tag has been converted to unicode with ‘\xe4’ in place of the ‘ä’: u'Te whakaako i Te Reo M\xe4ori -- Teaching Te Reo M\xe4ori'.

I would like to be able to have my Excel report include the character ‘ä’, but can’t seem to get it to encode in a way that achieves this.

I am potentially missing some obvious encode/decode point but have been struggling with this for much of the day, so any help is 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-06-05T04:41:08+00:00Added an answer on June 5, 2026 at 4:41 am

    You’re looking for codecs.open().

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

Sidebar

Related Questions

I have a SharePoint DLL that does some licensing things and as part of
I have a custom workflow that uses the Collect data from a user action,
I have created a webservice that can upload files to my sharepoint site library.
I have created infopath form library in SharePoint sever2010. I am using Windows server
I have some data that's currently stored in an Excel workbook. It makes sense
On my SharePoint 2010 site I have a list of items (Document Library). This
I have a document library with a workflow that dynamicly sets user permissions to
I have a document library in SharePoint. When a new file is uploaded to
We have a sharepoint instance on our network that we get automatically logged into
I have multiple SharePoint lists and want to display data from them on to

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.