Sunday 10 July 2011

File Format

Files should be saved with Unicode (UTF-8) encoding. The BOM should not be used. Unlike UTF-16 and UTF-32, there's no byte order to indicate in a UTF-8 encoded file, and the BOM can have a negative side effect in PHP of sending output, preventing the application from being able to set its own headers. Unix line endings should be used (LF).
Here is how to apply these settings in some of the more common text editors. Instructions for your text editor may vary; check your text editor's documentation.
TextMate
  1. Open the Application Preferences
  2. Click Advanced, and then the "Saving" tab
  3. In "File Encoding", select "UTF-8 (recommended)"
  4. In "Line Endings", select "LF (recommended)"
  5. Optional: Check "Use for existing files as well" if you wish to modify the line endings of files you open to your new preference.
BBEdit
  1. Open the Application Preferences
  2. Select "Text Encodings" on the left.
  3. In "Default text encoding for new documents", select "Unicode (UTF-8, no BOM)"
  4. Optional: In "If file's encoding can't be guessed, use", select "Unicode (UTF-8, no BOM)"
  5. Select "Text Files" on the left.
  6. In "Default line breaks", select "Mac OS X and Unix (LF)"

No comments:

Post a Comment