From 9babd66d3f0a115ce2113ca9ed6f4ab10af090e9 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 14 Nov 2008 02:09:00 +0000 Subject: added file format guidelines --- user_guide/general/styleguide.html | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'user_guide') diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 43385d064..feccbd7b2 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -69,6 +69,7 @@ Style Guide

Table of Contents

+
  • + +

    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. +
    3. Click Advanced, and then the "Saving" tab
    4. +
    5. In "File Encoding", select "UTF-8 (recommended)"
    6. +
    7. In "Line Endings", select "LF (recommended)"
    8. +
    9. Optional: Check "Use for existing files as well" if you wish to modify the line + endings of files you open to your new preference.
    10. +
    + +
    BBEdit
    + +
      +
    1. Open the Application Preferences
    2. +
    3. Select "Text Encodings" on the left.
    4. +
    5. In "Default text encoding for new documents", select "Unicode (UTF-8, no BOM)"
    6. +
    7. Optional: In "If file's encoding can't be guessed, use", select + "Unicode (UTF-8, no BOM)"
    8. +
    9. Select "Text Files" on the left.
    10. +
    11. In "Default line breaks", select "Mac OS X and Unix (LF)"
    12. +
    +
    +

    PHP Closing Tag

    The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced -- cgit v1.2.3-24-g4f1b