utfnormal
Unicode normalization for PHP
Loading...
Searching...
No Matches
UtfNormal\Utils Class Reference

Static Public Member Functions

static codepointToUtf8 ( $codepoint)
 Return UTF-8 sequence for a given Unicode code point.
 
static hexSequenceToUtf8 ( $sequence)
 Take a series of space-separated hexadecimal numbers representing Unicode code points and return a UTF-8 string composed of those characters.
 
static utf8ToCodepoint ( $char)
 Determine the Unicode codepoint of a single-character UTF-8 sequence.
 
static escapeSingleString ( $string)
 Escape a string for inclusion in a PHP single-quoted string literal.
 

Member Function Documentation

◆ codepointToUtf8()

static UtfNormal\Utils::codepointToUtf8 (   $codepoint)
static

Return UTF-8 sequence for a given Unicode code point.

Parameters
int$codepoint
Returns
string
Exceptions
InvalidArgumentExceptionif fed out of range data.

◆ escapeSingleString()

static UtfNormal\Utils::escapeSingleString (   $string)
static

Escape a string for inclusion in a PHP single-quoted string literal.

Parameters
string$stringString to be escaped.
Returns
string Escaped string.

◆ hexSequenceToUtf8()

static UtfNormal\Utils::hexSequenceToUtf8 (   $sequence)
static

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.

Parameters
string$sequence
Returns
string
Exceptions
InvalidArgumentExceptionif fed out of range data. Used in tests and data table generation

◆ utf8ToCodepoint()

static UtfNormal\Utils::utf8ToCodepoint (   $char)
static

Determine the Unicode codepoint of a single-character UTF-8 sequence.

Does not check for invalid input data.

Deprecated:
since 2.1, use mb_ord()
Parameters
string$char
Returns
int|false

The documentation for this class was generated from the following file: