From: Brion Vibber Date: Sun, 29 Aug 2004 02:04:01 +0000 (+0000) Subject: Adjust UTF-8 generator for correctness. (Upper private use area, probably affects... X-Git-Tag: 1.5.0alpha1~2204 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=d2246bff7c5458c26e639d1daf30c3383771d9bc;p=lhc%2Fweb%2Fwiklou.git Adjust UTF-8 generator for correctness. (Upper private use area, probably affects nothing.) --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index d762933a8d..9d156dd023 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -145,11 +145,12 @@ function wfUtf8Sequence( $codepoint ) { if($codepoint < 0x10000) return chr($codepoint >> 12 & 0x0f | 0xe0) . chr($codepoint >> 6 & 0x3f | 0x80) . chr($codepoint & 0x3f | 0x80); - if($codepoint < 0x100000) return chr($codepoint >> 18 & 0x07 | 0xf0) . # Double-check this + if($codepoint < 0x110000) return chr($codepoint >> 18 & 0x07 | 0xf0) . chr($codepoint >> 12 & 0x3f | 0x80) . chr($codepoint >> 6 & 0x3f | 0x80) . chr($codepoint & 0x3f | 0x80); - # Doesn't yet handle outside the BMP + + # There should be no assigned code points outside this range, but... return "&#$codepoint;"; }