summaryrefslogtreecommitdiffstats
path: root/user_guide/general/styleguide.html
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide/general/styleguide.html')
-rw-r--r--user_guide/general/styleguide.html38
1 files changed, 38 insertions, 0 deletions
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
<h2>Table of Contents</h2>
<ul class="minitoc">
+ <li><a href="#file_format">File Format</a></li>
<li><a href="#php_closing_tag">PHP Closing Tag</a></li>
<li><a href="#class_and_method_naming">Class and Method Naming</a></li>
<li><a href="#variable_names">Variable Names</a></li>
@@ -98,6 +99,43 @@ Style Guide
<li><a href="#overlapping_tag_parameters">Overlapping Tag Parameters</a></li>
</ul>
+<li>
+
+ <h2><a name="file_format"></a>File Format</h2>
+ <div class="guidelineDetails">
+ <p>Files should be saved with Unicode (UTF-8) encoding. The <abbr title="Byte Order Mark">BOM</abbr>
+ should <em>not</em> be used. Unlike UTF-16 and UTF-32, there's no byte order to indicate in
+ a UTF-8 encoded file, and the <abbr title="Byte Order Mark">BOM</abbr> 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).</p>
+
+ <p>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.</p>
+
+ <h5>TextMate</h5>
+
+ <ol>
+ <li>Open the Application Preferences</li>
+ <li>Click Advanced, and then the "Saving" tab</li>
+ <li>In "File Encoding", select "UTF-8 (recommended)"</li>
+ <li>In "Line Endings", select "LF (recommended)"</li>
+ <li><em>Optional:</em> Check "Use for existing files as well" if you wish to modify the line
+ endings of files you open to your new preference.</li>
+ </ol>
+
+ <h5>BBEdit</h5>
+
+ <ol>
+ <li>Open the Application Preferences</li>
+ <li>Select "Text Encodings" on the left.</li>
+ <li>In "Default text encoding for new documents", select "Unicode (UTF-8, no BOM)"</li>
+ <li><em>Optional:</em> In "If file's encoding can't be guessed, use", select
+ "Unicode (UTF-8, no BOM)"</li>
+ <li>Select "Text Files" on the left.</li>
+ <li>In "Default line breaks", select "Mac OS X and Unix (LF)"</li>
+ </ol>
+ </div>
+
<h2><a name="php_closing_tag"></a>PHP Closing Tag</h2>
<div class="guidelineDetails">
<p>The PHP closing tag on a PHP document <strong>?&gt;</strong> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced