aboutsummaryrefslogtreecommitdiffstats
path: root/includes/normal
diff options
context:
space:
mode:
Diffstat (limited to 'includes/normal')
-rw-r--r--includes/normal/Utf8Test.php13
-rw-r--r--includes/normal/UtfNormal.php32
-rw-r--r--includes/normal/UtfNormalBench.php8
-rw-r--r--includes/normal/UtfNormalTest.php13
-rw-r--r--includes/normal/UtfNormalUtil.php11
5 files changed, 54 insertions, 23 deletions
diff --git a/includes/normal/Utf8Test.php b/includes/normal/Utf8Test.php
index c3ab2498e111..49d2f86a87f7 100644
--- a/includes/normal/Utf8Test.php
+++ b/includes/normal/Utf8Test.php
@@ -17,9 +17,14 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# http://www.gnu.org/copyleft/gpl.html
-# Runs the UTF-8 decoder test at:
-# http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
-
+/**
+ * Runs the UTF-8 decoder test at:
+ * http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
+ *
+ * @package MediaWiki
+ */
+
+/** */
require_once 'UtfNormalUtil.php';
require_once 'UtfNormal.php';
mb_internal_encoding( "utf-8" );
@@ -142,4 +147,4 @@ function testLine( $test, $line, &$total, &$success, &$failed ) {
}
}
-?> \ No newline at end of file
+?>
diff --git a/includes/normal/UtfNormal.php b/includes/normal/UtfNormal.php
index 5ccdf0cde7d4..9dfc0a71bb24 100644
--- a/includes/normal/UtfNormal.php
+++ b/includes/normal/UtfNormal.php
@@ -17,17 +17,22 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# http://www.gnu.org/copyleft/gpl.html
-# Unicode normalization routines for working with UTF-8 strings.
-# Currently assumes that input strings are valid UTF-8!
-#
-# Not as fast as I'd like, but should be usable for most purposes.
-# UtfNormal::toNFC() will bail early if given ASCII text or text
-# it can quickly deterimine is already normalized.
-#
-# All functions can be called static.
-#
-# See description of forms at http://www.unicode.org/reports/tr15/
+/**
+ * Unicode normalization routines for working with UTF-8 strings.
+ * Currently assumes that input strings are valid UTF-8!
+ *
+ * Not as fast as I'd like, but should be usable for most purposes.
+ * UtfNormal::toNFC() will bail early if given ASCII text or text
+ * it can quickly deterimine is already normalized.
+ *
+ * All functions can be called static.
+ *
+ * See description of forms at http://www.unicode.org/reports/tr15/
+ *
+ * @package MediaWiki
+ */
+/** */
require_once 'UtfNormalUtil.php';
require_once 'UtfNormalData.inc';
@@ -87,7 +92,10 @@ define( 'UTF8_FFFF', codepointToUtf8( 0xffff ) );
define( 'UTF8_HEAD', false );
define( 'UTF8_TAIL', true );
-
+/**
+ *
+ * @package MediaWiki
+ */
class UtfNormal {
# The ultimate convenience function! Clean up invalid UTF-8 sequences,
# and convert to normal form C. Faster on pure ASCII strings, or
@@ -471,4 +479,4 @@ class UtfNormal {
}
}
-?> \ No newline at end of file
+?>
diff --git a/includes/normal/UtfNormalBench.php b/includes/normal/UtfNormalBench.php
index dcb83cf503ed..c37fb469283b 100644
--- a/includes/normal/UtfNormalBench.php
+++ b/includes/normal/UtfNormalBench.php
@@ -17,6 +17,12 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# http://www.gnu.org/copyleft/gpl.html
+/**
+ *
+ * @package MediaWiki
+ */
+
+/** */
require_once 'UtfNormalUtil.php';
require_once 'UtfNormal.php';
@@ -76,4 +82,4 @@ function benchmarkForm( &$u, &$data, $form ) {
printf( " %20s %1.4fs %8d bytes/s (%s)\n", $form, $delta, $rate, ($same ? 'no change' : 'changed' ) );
}
-?> \ No newline at end of file
+?>
diff --git a/includes/normal/UtfNormalTest.php b/includes/normal/UtfNormalTest.php
index 5a37edfd33e6..6360a7ca445c 100644
--- a/includes/normal/UtfNormalTest.php
+++ b/includes/normal/UtfNormalTest.php
@@ -17,9 +17,13 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# http://www.gnu.org/copyleft/gpl.html
-# Implements the conformance test at:
-# http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt
+/**
+ * Implements the conformance test at:
+ * http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt
+ * @package MediaWiki
+ */
+/** */
$verbose = true;
#define( 'PRETTY_UTF8', true );
@@ -30,6 +34,9 @@ if( defined( 'PRETTY_UTF8' ) ) {
$string );
}
} else {
+ /**
+ * @ignore
+ */
function pretty( $string ) {
return trim( preg_replace( '/(.)/use',
'sprintf("%04X ", utf8ToCodepoint("$1"))',
@@ -216,4 +223,4 @@ function testInvariant( &$u, $char, $desc, $reportFailure = false ) {
return $result;
}
-?> \ No newline at end of file
+?>
diff --git a/includes/normal/UtfNormalUtil.php b/includes/normal/UtfNormalUtil.php
index da8823fa5d8d..039ac3c09003 100644
--- a/includes/normal/UtfNormalUtil.php
+++ b/includes/normal/UtfNormalUtil.php
@@ -17,9 +17,14 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# http://www.gnu.org/copyleft/gpl.html
-# Some of these functions are adapted from places in MediaWiki.
-# Should probably merge them for consistency.
+/**
+ * Some of these functions are adapted from places in MediaWiki.
+ * Should probably merge them for consistency.
+ *
+ * @package MediaWiki
+ */
+/** */
function codepointToUtf8( $codepoint ) {
if($codepoint < 0x80) return chr($codepoint);
if($codepoint < 0x800) return chr($codepoint >> 6 & 0x3f | 0xc0) .
@@ -86,4 +91,4 @@ function escapeSingleString( $string ) {
));
}
-?> \ No newline at end of file
+?>