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:
db6c4af
)
Add a utf-8 to hex sequence function for debugging
author
Brion Vibber
<brion@users.mediawiki.org>
Mon, 15 Nov 2004 00:58:36 +0000
(
00:58
+0000)
committer
Brion Vibber
<brion@users.mediawiki.org>
Mon, 15 Nov 2004 00:58:36 +0000
(
00:58
+0000)
includes/normal/UtfNormalUtil.php
patch
|
blob
|
history
diff --git
a/includes/normal/UtfNormalUtil.php
b/includes/normal/UtfNormalUtil.php
index
53f2c36
..
06e0bb4
100644
(file)
--- a/
includes/normal/UtfNormalUtil.php
+++ b/
includes/normal/UtfNormalUtil.php
@@
-68,6
+68,20
@@
function hexSequenceToUtf8( $sequence ) {
return $utf;
}
+/**
+ * Take a UTF-8 string and return a space-separated series of hex
+ * numbers representing Unicode code points. For debugging.
+ *
+ * @param string $str
+ * @return string
+ * @access private
+ */
+function utf8ToHexSequence( $str ) {
+ return rtrim( preg_replace( '/(.)/uSe',
+ 'sprintf("%04x ", utf8ToCodepoint("$1"))',
+ $str ) );
+}
+
/**
* Determine the Unicode codepoint of a single-character UTF-8 sequence.
* Does not check for invalid input data.