-->

How to change “Character Encoding” property of Rat

2019-06-05 06:36发布

问题:

The Eclipse compare view shows four properties for files stored in RTC:

  • Executable
  • MIME Type
  • Line Delimiter
  • Character Encoding

I know how to change the first three of them using the Eclipse or the Visual Studio client, but how can I change the “Character Encoding”?

回答1:

This thread mentions:

To change the file's encoding on server side, you need to load the file into an Eclipse project, then right-click the file and select "Properties".
In the Properties, set the file encoding to "UTF-8".
Then you need to make slightly change on the file content, so you can check-in/deliver the file from Pending Changes.
After that if you open the repository files from the workspace or stream and check it properties, you can see the file encoding is updated.

If you are using Visual Studio client, there's no direct way to modify a single file's properties. You need to edit magic.properties file to change the file's encoding on client side first, then modify the file and check-in to server side.

Note, as mentioned in this thread:

Text encoding isn't handled by source control. It's however the client is set to interpret the file.
For Eclipse clients, there are preferences for the encoding that users can set for each type of file. Eclipse can also set the encoding per project. So the change you're making in the GUI isn't being shared with source control.