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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:21:07+00:00 2026-06-10T19:21:07+00:00

I have a .NET application written in C# that saves information in XML format.

  • 0

I have a .NET application written in C# that saves information in XML format. The application serializes the application data into xml. The application contains a textbox where the user is free to enter any text. I have cases where users have managed to enter characters, mostly when they copy and paste text from other applications into the textbox, where the xml document becomes corrupted. Is there a general approach to manage illegal characters in xml documents without having to filter them out in every textbox on entry.

Sample from document thats corrupted

<Propery>
  <Name>&#x8;Alimentação Controlador</Name>
  <Value>24</Value>
  <Unit>Vca</Unit>
</Propery>

Document is serialized with ASCIIEncoding.UTF8

  • 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-10T19:21:08+00:00Added an answer on June 10, 2026 at 7:21 pm

    I think your best bet is to “SafeEncode” the string entered by the user. this link http://msdn.microsoft.com/en-us/library/system.security.securityelement.escape(VS.80).aspx shows you how to do it easily with one call to the SecurityElement.Escape(string s) method.

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

Sidebar

Related Questions

I have this code in my ASP.NET application written in C# that is trying
We have an application written in both C++ and .NET that installs for all
I have a WinForms application written in C# for .NET 3.5 that needs to
I have a simple application written in C# and .Net 2.0 that displays several
I have an application that was written in vanilla ASP.NET that I would like
I have to support an application that was written in .NET 1.1 many years
I have a .NET application that was written in C# and VB.NET using WinForms.
I currently have a TCP server application written in .Net that receives and submits
I have an application that is an asmx web service written in .NET 2.0
I'm trying to port over a .NET application that was written in C#, into

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.