Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

characters getting inserted into beginning of file.

Some developers alerted me to characters in the beginning of c sharp files. These files are text based. When ever I tried to open a file in RTC to verify this it would open in Visual Studio. Then I created a file association to open cs files using a text editor. Once I did this, if I opened a file I saw those strange characters. For an experiment I removed those characters, did a refresh in the pending changes view and then compared the differences. RTC is reporting a change but the difference isn't showing anything.

0 votes



3 answers

Permanent link
Those characters belong in the file. They are a Byte Order Mark (BOM) that identifies the character encoding of the file. Any text editor that shows those characters is not interpreting the encoding of the file properly. You wont see the characters in Eclipse-based (i.e. RTC client) or the VS clients because they interpret the BOM properly. You can google "UTF-8 BOM Visual Studio" if you want to learn more about this.

0 votes


Permanent link
Those characters belong in the file. They are a Byte Order Mark (BOM) that identifies the character encoding of the file. Any text editor that shows those characters is not interpreting the encoding of the file properly. You wont see the characters in Eclipse-based (i.e. RTC client) or the VS clients because they interpret the BOM properly. You can google "UTF-8 BOM Visual Studio" if you want to learn more about this.


Except I do see those characters in RTC client. Also I see strange characters in other parts of the file. I see this in line 10 of a file:
//* 2010

A developer sent me this:
Then it is an issue with their merge utility. Because they are duplicating these characters at the beginning of the file when they merge a file that has changes at the beginning of the file. I think you will be able to recreate the issue by creating a file with several lines of text. Then under a separate user make changes at the top of the file (like adding the standard comments we put at the top of source code.) Then check in and deliver the change as that user. Then as the original user prior to accepting these changes, make changes to the top of the file and check it in. When the system merges the files it should cause a conflict. Click the little arrow to combine the text at the top of the file, I am betting you will see it duplicate these characters at the top of the file.

And last night he sent me this :
I confirmed several times tonight that this should recreate the issue. The interesting thing is that I found a follow on issue. When this happens the encoded file type can change and special characters can be corrupted. Here is an example below.

configurationCommand = configurationCommand.Replace("' key='", "");
configurationCommand = configurationCommand.Replace("' value='", "");
configurationCommand = configurationCommand.Replace("'", "");

string[] words = configurationCommand.Split('');


was changed to

configurationCommand = configurationCommand.Replace("' key='", "");
configurationCommand = configurationCommand.Replace("' value='", "");
configurationCommand = configurationCommand.Replace("'", "");

string[] words = configurationCommand.Split('');

0 votes


Permanent link
In that case, you should open a work item and provide the steps you took to reproduce the issue.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,926

Question asked: Sep 20 '11, 7:27 p.m.

Question was seen: 6,009 times

Last updated: Sep 20 '11, 7:27 p.m.

Confirmation Cancel Confirm