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

How to stop RTC from converting Unicode files to big endian?

I have a new Unicode (little-endian) file and I check it into RTC. I then delete the file from my eclipse workspace, ask the RTC client to refresh the sandbox and remote changes and it shows me that the file has been deleted. In the pending changes view in RTC I then right-click on the missing file and select Undo which should put the file back into my Eclipse workspace. It does, but the file is now big-endian. Checking in a new revision of the file does not rectify the problem.

I have searched the RTC client for a setting that might be affecting this and I have searched this forum but can't find any other mention of it. I would like Unicode files to keep their endianness when I store them in RTC. Can anyone help?

I am using the RTC client version 3.0.1 for Windows, running on Windows XP SP3 32bit.

Thanks,

Simon.

0 votes


Accepted answer

Permanent link
Hi Simon:

Try the following (assuming you are using the RTC Eclipse client):
1. Select the file in the project explorer or package explorer
2. Right click > Properties > Resources > Text File Encoding
Select UTF-16-LE. The RTC Eclipse client now treats this content as UTF-16-LE which is similar to UCS2 little endian.
3. Check-in the file (if it's a new file you are adding - otherwise after you modify its content) into a change set in your repo workspace and deliver to your stream. Now the RTC server knows that file in that workspace and stream are using the encoding UTF-16-LE.
4. When someone in your team accepts your changes, their version should be treated as UTF-16-LE from now on. Because the encoding was set unambiguously, there won't be random conversion to big endian anymore.

Thanks to Dmitry K. from SCM for the details.

Christophe Cornu
Simon Fox selected this answer as the correct answer

1 vote


6 other answers

Permanent link
In case it makes any difference, the files in question are in UCS2 encoding and have the .txt file extension.

Simon.

0 votes


Permanent link
> I check it into RTC
Simon, what were the Source Control file properties such as content type, encoding, line delimiter after the check-in? This will help others provide the right answer. If you don't get a good answer, open a work item and attach your file (if possible) with steps. Maybe the content type and encoding have to be set right.

Christophe Cornu

0 votes


Permanent link
I've carried out some further experiments and here are the results:
- If I change the file extension (from .txt to no extension) the problem does not occur.
- If my colleague checks the file into a component in his RTC project from his PC (with the original .txt extension) the problem does not occur.
- If my colleague checks the file into the original component in my RTC project (with the original .txt extension) on his PC the problem does not occur
- When I check the file into the original component on my PC with the original .txt extension the character encoding is shown in RTC as UTF-16
- When my colleague checks the file into the original component on his PC with the original .txt extension the character encoding is shown in RTC as UTF-16LE
- When I check the file into my component on my PC with no file extension the character encoding is shown in RTC as CP1252

So, to summarise, the problem only occurs on my PC and only with files that have a .txt file extension. I have had a hunt through the options in my RTC client for anything that might be affecting this and can't find anything. My colleague is not aware of having changed any settings that might affect it either and we're both using the same client version (3.0.1, build RTC-I20110602-0252).

If anyone knows what setting(s) might be causing this I would be very grateful if you could let me know.

Thanks again,

Simon.

0 votes


Permanent link
> - If I change the file extension (from .txt to no extension) the problem does not occur.
Probably because in that case the IDE doesn't check-it in with text/plain content type but treats it as binary and no charset conversion occurs. I'm not sure if the conversion occurs in the IDE (when an editor reads and saves the file locally) or in the RTC server (when it uploads its content during a check-in).
Can you open a work item against RTC Source Control with your file? We'll try to reproduce and get any detail necessary.

Thanks,
Christophe Cornu

0 votes


Permanent link
Many thanks Christophe - that does indeed fix it.

I'm still not sure why my colleague doesn't have the same issue but at least I have a solution :-)

Thanks again,

Simon.

0 votes


Permanent link
We have similar issue, file is encoded as UTF16-BE if we load it into 64bit Windows OS, but UTF16-LE if we load it into 32bit Windows OS.

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

Question asked: Jan 05 '12, 7:47 a.m.

Question was seen: 7,938 times

Last updated: Aug 12 '13, 9:13 p.m.

Confirmation Cancel Confirm