Search code examples
xcodeconfigurationutf-8character-encodingxcode4

How change the file codification in XCode 4


I am having bad times with my CVS and Xcode 4.0.2. Are there a easy way to change the codification of all files? I have to use UTF8, because I use portuguese accents.

If I enter a non ASCII character like ¹²³ (option + (1, 2, 3)), the Xcode show the screen: Encoding Conflict than I can convert to UTF8.

It change in my (program name).xcodeproj/project.pbxproj the config line of this file from

{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = myfile.pch; sourceTree = "<group>"; };

to

{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = myfile.pch; sourceTree = "<group>"; };

(Look the change of fileEncoding = 4;)

My question is: How I change all files to this encoding (or only one encoding)?


Solution

  • I haven't found this documented anywhere, but my tests indicate fileEncoding = 4 corresponds to Unicode (UTF-8). Sounds like you are good there. You can also set your default encoding to UTF-8 in Xcode preferences.

    So, CVS... can we talk? This is ancient technology. You might as well be asking about writing to 5.25" floppy drives. At the very least, you should be upgrading to subversion pronto. Better -- no, make that way better -- upgrade to git or mercurial. You don't need to invest a moment longer in technology that's been obsolete for years. I actually like using git, and consider it possibly my most valuable tool.