This tip expands on a note I read in the cocoa-dev mailing list.
As it ships, TextEdit can open files in nine encodings, including Unicode, UTF-8 and Shift-JIS. This is pretty handy, but there's more - it is fairly easy to change the list of supported encodings to include any of the over 100 built in to Cocoa.
Here is how you do it:
To continue with this tip, you will need the developer tools. Assuming you have them, do this:
As it ships, TextEdit can open files in nine encodings, including Unicode, UTF-8 and Shift-JIS. This is pretty handy, but there's more - it is fairly easy to change the list of supported encodings to include any of the over 100 built in to Cocoa.
Here is how you do it:
- In the Finder, control-click on the TextEdit application and select Show Package Contents. This opens a new window with a Contents folder.
- Open Contents/Resources
- Make a copy of the file MoreEncodings.plist; call the copy Encodings.plist
To continue with this tip, you will need the developer tools. Assuming you have them, do this:
- Open Encodings.plist in PropertyListEditor or a text editor.
- Open the file /System -> Library -> Frameworks -> CoreFoundation.framework -> Versions -> A -> Headers -> CFStringEncodingExt.h in a text editor. This file lists all the encodings supported in Cocoa. By adding entries to Encodings.plist you will get support for the corresponding encoding in TextEdit.
- Note that you will have to convert the hexadecimal values in CFStringEncodingExt.h to decimal values to put in Encodings.plist. I use PCalc to do this.
•
[2,923 views]

