diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-03-18 09:36:40 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-03-18 09:36:40 +0100 |
commit | 218e04a1e46e7657e607dafae3e1ae651afe2998 (patch) | |
tree | 5bac8fb825a7634e70d38e4f81ad56e157bf781c /phpBB/docs/coding-guidelines.html | |
parent | c68f7671d29fb824ef3c05a6b592fabb7ae1cdb8 (diff) | |
download | forums-218e04a1e46e7657e607dafae3e1ae651afe2998.tar forums-218e04a1e46e7657e607dafae3e1ae651afe2998.tar.gz forums-218e04a1e46e7657e607dafae3e1ae651afe2998.tar.bz2 forums-218e04a1e46e7657e607dafae3e1ae651afe2998.tar.xz forums-218e04a1e46e7657e607dafae3e1ae651afe2998.zip |
[ticket/12286] Remove section about utf8_normalize_nfc()
The request class takes care of this
PHPBB3-12286
Diffstat (limited to 'phpBB/docs/coding-guidelines.html')
-rw-r--r-- | phpBB/docs/coding-guidelines.html | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 27f639f855..45bdb5d422 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1784,19 +1784,6 @@ Käse K??se </pre></div> -<h4>Unicode Normalization</h4> - -<p>If you retrieve user input with multibyte characters you should additionally normalize the string using <code>utf8_normalize_nfc()</code> before you work with it. This is necessary to make sure that equal characters can only occur in one particular binary representation. For example the character Å can be represented either as <code>U+00C5</code> (LATIN CAPITAL LETTER A WITH RING ABOVE) or as <code>U+212B</code> (ANGSTROM SIGN). phpBB uses Normalization Form Canonical Composition (NFC) for all text. So the correct version of the above example would look like this:</p> - -<div class="codebox"><pre> -$_REQUEST['multibyte_string'] = 'Käse'; - -// normalize multibyte strings -echo utf8_normalize_nfc($request->variable('multibyte_string', '', true)); -// ASCII strings do not need to be normalized -echo $request->variable('multibyte_string', ''); -</pre></div> - <h4>Case Folding</h4> <p>Case insensitive comparison of strings is no longer possible with <code>strtolower</code> or <code>strtoupper</code> as some characters have multiple lower case or multiple upper case forms depending on their position in a word. The <code>utf8_strtolower</code> and the <code>utf8_strtoupper</code> functions suffer from the same problem so they can only be used to display upper/lower case versions of a string but they cannot be used for case insensitive comparisons either. So instead you should use case folding which gives you a case insensitive version of the string which can be used for case insensitive comparisons. An NFC normalized string can be case folded using <code>utf8_case_fold_nfc()</code>.</p> |