dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e1ef8b4
)
Munge doc comments. Mark as its own package for docs.
author
Brion Vibber
<brion@users.mediawiki.org>
Thu, 28 Oct 2004 02:56:13 +0000
(
02:56
+0000)
committer
Brion Vibber
<brion@users.mediawiki.org>
Thu, 28 Oct 2004 02:56:13 +0000
(
02:56
+0000)
includes/normal/Utf8Test.php
patch
|
blob
|
history
includes/normal/UtfNormal.php
patch
|
blob
|
history
includes/normal/UtfNormalBench.php
patch
|
blob
|
history
includes/normal/UtfNormalGenerate.php
patch
|
blob
|
history
includes/normal/UtfNormalTest.php
patch
|
blob
|
history
includes/normal/UtfNormalUtil.php
patch
|
blob
|
history
diff --git
a/includes/normal/Utf8Test.php
b/includes/normal/Utf8Test.php
index
49d2f86
..
ba3555e
100644
(file)
--- a/
includes/normal/Utf8Test.php
+++ b/
includes/normal/Utf8Test.php
@@
-21,7
+21,8
@@
* 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
+ * @package UtfNormal
+ * @access private
*/
/** */
*/
/** */
diff --git
a/includes/normal/UtfNormal.php
b/includes/normal/UtfNormal.php
index
8626799
..
75e68a7
100644
(file)
--- a/
includes/normal/UtfNormal.php
+++ b/
includes/normal/UtfNormal.php
@@
-29,7
+29,7
@@
*
* See description of forms at http://www.unicode.org/reports/tr15/
*
*
* See description of forms at http://www.unicode.org/reports/tr15/
*
- * @package
MediaWiki
+ * @package
UtfNormal
*/
/** */
*/
/** */
diff --git
a/includes/normal/UtfNormalBench.php
b/includes/normal/UtfNormalBench.php
index
d42d592
..
f035542
100644
(file)
--- a/
includes/normal/UtfNormalBench.php
+++ b/
includes/normal/UtfNormalBench.php
@@
-18,8
+18,10
@@
# http://www.gnu.org/copyleft/gpl.html
/**
# http://www.gnu.org/copyleft/gpl.html
/**
- *
- * @package MediaWiki
+ * Approximate benchmark for some basic operations.
+ *
+ * @package UtfNormal
+ * @access private
*/
/** */
*/
/** */
diff --git
a/includes/normal/UtfNormalGenerate.php
b/includes/normal/UtfNormalGenerate.php
index
436c918
..
65128b7
100644
(file)
--- a/
includes/normal/UtfNormalGenerate.php
+++ b/
includes/normal/UtfNormalGenerate.php
@@
-21,7
+21,8
@@
* This script generates UniNormalData.inc from the Unicode Character Database
* and supplementary files.
*
* This script generates UniNormalData.inc from the Unicode Character Database
* and supplementary files.
*
- * @package MediaWiki
+ * @package UtfNormal
+ * @access private
*/
/** */
*/
/** */
diff --git
a/includes/normal/UtfNormalTest.php
b/includes/normal/UtfNormalTest.php
index
16992be
..
108bf5c
100644
(file)
--- a/
includes/normal/UtfNormalTest.php
+++ b/
includes/normal/UtfNormalTest.php
@@
-20,7
+20,7
@@
/**
* 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
+ * @package
UtfNormal
*/
/** */
*/
/** */
diff --git
a/includes/normal/UtfNormalUtil.php
b/includes/normal/UtfNormalUtil.php
index
039ac3c
..
53f2c36
100644
(file)
--- a/
includes/normal/UtfNormalUtil.php
+++ b/
includes/normal/UtfNormalUtil.php
@@
-21,10
+21,20
@@
* 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
+ * @package UtfNormal
+ * @access public
*/
/** */
*/
/** */
+
+/**
+ * Return UTF-8 sequence for a given Unicode code point.
+ * May die if fed out of range data.
+ *
+ * @param int $codepoint
+ * @return string
+ * @access public
+ */
function codepointToUtf8( $codepoint ) {
if($codepoint < 0x80) return chr($codepoint);
if($codepoint < 0x800) return chr($codepoint >> 6 & 0x3f | 0xc0) .
function codepointToUtf8( $codepoint ) {
if($codepoint < 0x80) return chr($codepoint);
if($codepoint < 0x800) return chr($codepoint >> 6 & 0x3f | 0xc0) .
@@
-40,6
+50,15
@@
function codepointToUtf8( $codepoint ) {
die("Asked for code outside of range ($codepoint)\n");
}
die("Asked for code outside of range ($codepoint)\n");
}
+/**
+ * Take a series of space-separated hexadecimal numbers representing
+ * Unicode code points and return a UTF-8 string composed of those
+ * characters. Used by UTF-8 data generation and testing routines.
+ *
+ * @param string $sequence
+ * @return string
+ * @access private
+ */
function hexSequenceToUtf8( $sequence ) {
$utf = '';
foreach( explode( ' ', $sequence ) as $hex ) {
function hexSequenceToUtf8( $sequence ) {
$utf = '';
foreach( explode( ' ', $sequence ) as $hex ) {
@@
-49,6
+68,14
@@
function hexSequenceToUtf8( $sequence ) {
return $utf;
}
return $utf;
}
+/**
+ * Determine the Unicode codepoint of a single-character UTF-8 sequence.
+ * Does not check for invalid input data.
+ *
+ * @param string $char
+ * @return int
+ * @access public
+ */
function utf8ToCodepoint( $char ) {
# Find the length
$z = ord( $char{0} );
function utf8ToCodepoint( $char ) {
# Find the length
$z = ord( $char{0} );
@@
-79,10
+106,16
@@
function utf8ToCodepoint( $char ) {
$z |= ord( $char{$i} ) & 0x3f;
}
$z |= ord( $char{$i} ) & 0x3f;
}
- # Make entity
return $z;
}
return $z;
}
+/**
+ * Escape a string for inclusion in a PHP single-quoted string literal.
+ *
+ * @param string $string
+ * @return string
+ * @access public
+ */
function escapeSingleString( $string ) {
return strtr( $string,
array(
function escapeSingleString( $string ) {
return strtr( $string,
array(