MediaWiki REL1_31
UtfNormalUtil.php
Go to the documentation of this file.
1<?php
28use UtfNormal\Utils;
29
39function codepointToUtf8( $codepoint ) {
40 wfDeprecated( __FUNCTION__, '1.25' );
41 return Utils::codepointToUtf8( $codepoint );
42}
43
55function hexSequenceToUtf8( $sequence ) {
56 wfDeprecated( __FUNCTION__, '1.25' );
57 return Utils::hexSequenceToUtf8( $sequence );
58}
59
69function utf8ToHexSequence( $str ) {
70 wfDeprecated( __FUNCTION__, '1.25' );
71 $buf = '';
72 foreach ( preg_split( '//u', $str, -1, PREG_SPLIT_NO_EMPTY ) as $cp ) {
73 $buf .= sprintf( '%04x ', UtfNormal\Utils::utf8ToCodepoint( $cp ) );
74 }
75
76 return rtrim( $buf );
77}
78
88function utf8ToCodepoint( $char ) {
89 wfDeprecated( __FUNCTION__, '1.25' );
90 return Utils::utf8ToCodepoint( $char );
91}
92
101function escapeSingleString( $string ) {
102 wfDeprecated( __FUNCTION__, '1.25' );
103 return Utils::escapeSingleString( $string );
104}
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
utf8ToCodepoint( $char)
Determine the Unicode codepoint of a single-character UTF-8 sequence.
escapeSingleString( $string)
Escape a string for inclusion in a PHP single-quoted string literal.
hexSequenceToUtf8( $sequence)
Take a series of space-separated hexadecimal numbers representing Unicode code points and return a UT...
utf8ToHexSequence( $str)
Take a UTF-8 string and return a space-separated series of hex numbers representing Unicode code poin...
codepointToUtf8( $codepoint)
Return UTF-8 sequence for a given Unicode code point.
Unicode normalization routines for working with UTF-8 strings.
Definition UtfNormal.php:48