in Education by
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 JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
This doesn't have to do with UTF-8 or character encodings - this problem has to do with line endings. In Windows, each line of a text file ends in the two characters carriage-return (CR) and newline (LF, for line feed), which are code points U+000D and U+000A respectively. In ASCII and UTF-8, these are encoded as the two bytes 0D 0A. Most non-Windows systems, including Linux and Mac OS X, on the other hand, uses just a newline character to signal end-of-line, so it's not uncommon to see line ending problems when transferring text files between Windows and non-Windows systems. However, since you're using just Windows on both systems, this is more of a mystery. One application is correctly interpreting the CRLF combination as a newline, but the other application is confused by the CR. Carriage returns are not printable characters, so it replaces the CR with a placeholder box, which is what you see; it then correctly interprets the line feed as the end-of-line.

Related questions

0 votes
    I have two computers. Both running WinXP SP2 (I don't really know ho similar they are beyond that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    I'm trying to import an XML file via a web page in a Ruby on Rails application, the code ruby ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    In pattern mapping problem in neural nets, is there any kind of generalization involved between input & output ... Introduction of Neural Networks Please answer the above question....
asked Sep 21, 2022 in Education by JackTerrance
0 votes
    I am trying to fetch some data from the GitHub GraphQL but I get a GaphQLError. I have tried the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 19, 2022 in Education by JackTerrance
0 votes
    I'm still trying to understand this piece of code that I found in a project I'm working on where ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 20, 2022 in Education by JackTerrance
0 votes
    I'm still trying to understand this piece of code that I found in a project I'm working on where ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Suman asked her friend Niharika her English Copy. However she didn't gave suman. What do you think might ... behind this communication. Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Suman asked her friend Niharika her English Copy. However she didn't gave Suman. What do you think might ... behind this communication. Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    How do you think this has benefitted them?...
asked Feb 22, 2021 in Technology by JackTerrance
0 votes
    Is it possible to generate this kind of random curves? I've tried IMagick bezier curves (see http:/ ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    ALL I am confused about the date field returned by microsoft academic rest api: JSON Example: { " ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    A ________ is a computer to which a user doesn't have physical access , which she can access or manipulate ... of computer network. Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Process of placing elements from a collection in some kind of order Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    If some of output patterns in pattern association problem are identical then problem shifts to? (a) pattern storage ... ) none of the mentioned Please answer the above question....
asked Sep 5, 2022 in Education by JackTerrance
...