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 -
If you retrieve user input with multibyte characters you should additionally normalize the string using utf8_normalize_nfc()
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 U+00C5
(LATIN CAPITAL LETTER A WITH RING ABOVE) or as U+212B
(ANGSTROM SIGN). phpBB uses Normalization Form Canonical Composition (NFC) for all text. So the correct version of the above example would look like this:
-$_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', ''); -
Case insensitive comparison of strings is no longer possible with strtolower
or strtoupper
as some characters have multiple lower case or multiple upper case forms depending on their position in a word. The utf8_strtolower
and the utf8_strtoupper
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 utf8_case_fold_nfc()
.