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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:04:47+00:00 2026-05-10T23:04:47+00:00

I have two computers. Both running WinXP SP2 (I don’t really know ho similar

  • 0

I have two computers. Both running WinXP SP2 (I don’t really know ho similar they are beyond that). I am running MS Visual C# 2008 express edition on both and that’s what I’m currently using to program.

I made an application that loads in an XML file and displays the contents in a DataGridView.

The first line of my xml file is:

<?xml version='1.0' encoding='utf-8'?> 

…and really… it’s utf-8 (at least according to MS VS C# when I just open the file there).

I compile the code and run it on one computer, and the contents of my DataGridView appears normal. No funny characters. I compile the code and run it on the other computer (or just take the published version from computer #1 and install it on computer #2 – I tried this both ways) and in the datagridview, where there are line breaks/new lines in the xml file, I see funny square characters.

I’m a novice to encoding… so the only thing I really tried to troubleshoot was to use that same program to write the contents of my xml to a new xml file (but I’m actually writing it to a text file, with the xml tags in it) since the default writing to a text file seems to be utf-8. Then I read this new file back in to my program. I get the same results.

I don’t know what else to do or how to troubleshoot this or what I might fundamentally be doing wrong in the first place.

-Adeena

  • 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. 2026-05-10T23:04:47+00:00Added an answer on May 10, 2026 at 11:04 pm

    I’m not sure of the cause of your problem, but one solution would be to to just strip out the carriage returns from your strings. For every string you add, just call TrimEnd(null) on it to remove trailing whitespace:

    newrow['topic'] = att1.ToString().TrimEnd(null); 

    If your strings might end in other whitespace (i.e. spaces or tabs) and you want to keep those, then just pass an array containing only the carriage return character to TrimEnd:

    newrow['topic' = att1.ToString().TrimEnd(new Char[]{'\r'}); 

    Disclaimer: I am not a C# programmer; the second statement may be syntactically incorrect

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

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You might want to handle this in your view function.… May 11, 2026 at 11:10 am
  • added an answer We use lzz which splits out a single file into… May 11, 2026 at 11:10 am
  • added an answer Short answer: GPEDIT.MSC (Start, Run, GPEdit.msc) Windows 2000 and above… May 11, 2026 at 11:10 am

Related Questions

I have two computers. Both running WinXP SP2 (I don't really know ho similar
I have two versions of rails (2.1.0 and 2.2.2) installed in my computer. When
I have a PPPOE connection on a computer. That computer has two LAN cards
I have two applications written in Java that communicate with each other using XML
I have two arrays of animals (for example). $array = array( array( 'id' =>
I have two arrays of System.Data.DataRow objects which I want to compare. The rows
I have two elements: <input a> <input b onclick=...> When b is clicked, I
I have two identical tables and need to copy rows from table to another.
I have two classes, and want to include a static instance of one class
I have two threads, one needs to poll a bunch of separate static resources

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.