Utility class for handling strings of different character encodings using available PHP extensions.

Declared abstract, as we have no need for instantiation.

package Default

 Methods

Get registered wrapper classes

getRegisteredWrappers() : array<mixed,string>
Static

Returns

array<mixed,string>

Get a list of all known single-byte character encodings

getSingleByteEncodings() : array<mixed,string>
Static

Returns

array<mixed,string>

Get the first string wrapper supporting the given character encoding and supports to convert into the given convert encoding.

getWrapper(string $encoding = 'UTF-8', string|null $convertEncoding = null) : \Zend\Stdlib\StringWrapper\StringWrapperInterface
Static

Parameters

$encoding

string

Character encoding to support

$convertEncoding

stringnull

OPTIONAL character encoding to convert in

Exceptions

\Zend\Stdlib\Exception\RuntimeException If no wrapper supports given character encodings

Returns

\Zend\Stdlib\StringWrapper\StringWrapperInterface

Is PCRE compiled with Unicode support?

hasPcreUnicodeSupport() : boolean
Static

Returns

boolean

Check if a given encoding is a known single-byte character encoding

isSingleByteEncoding(string $encoding) : boolean
Static

Parameters

$encoding

string

Returns

boolean

Check if a given string is valid UTF-8 encoded

isValidUtf8(string $str) : boolean
Static

Parameters

$str

string

Returns

boolean

Register a string wrapper class

registerWrapper(string $wrapper) : void
Static

Parameters

$wrapper

string

Reset all registered wrappers so the default wrappers will be used

resetRegisteredWrappers() : void
Static

Unregister a string wrapper class

unregisterWrapper(string $wrapper) : void
Static

Parameters

$wrapper

string

 Properties

 

Is PCRE compiled with Unicode support?

$hasPcreUnicodeSupport : boolean

Default

null
Static
 

A list of known single-byte character encodings (upper-case)

$singleByteEncodings : array<mixed,string>

Default

array('ASCII', '7BIT', '8BIT', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', 'ISO-8859-10', 'ISO-8859-11', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', 'CP-1251', 'CP-1252')
Static
 

Ordered list of registered string wrapper instances

$wrapperRegistry : array<mixed,\Zend\Stdlib\StringWrapper\StringWrapperInterface>

Default

null
Static