class UConverter (View source)

Constants

REASON_UNASSIGNED

REASON_ILLEGAL

REASON_IRREGULAR

REASON_RESET

REASON_CLOSE

REASON_CLONE

UNSUPPORTED_CONVERTER

SBCS

DBCS

MBCS

LATIN_1

UTF8

UTF16_BigEndian

UTF16_LittleEndian

UTF32_BigEndian

UTF32_LittleEndian

EBCDIC_STATEFUL

ISO_2022

LMBCS_1

LMBCS_2

LMBCS_3

LMBCS_4

LMBCS_5

LMBCS_6

LMBCS_8

LMBCS_11

LMBCS_16

LMBCS_17

LMBCS_18

LMBCS_19

LMBCS_LAST

HZ

SCSU

ISCII

US_ASCII

UTF7

BOCU1

UTF16

UTF32

CESU8

IMAP_MAILBOX

Methods

__construct(string $destination_encoding = null, string $source_encoding = null)

(PHP 5 >=5.5.0)
Create UConverter object

string|false
convert(string $str, bool $reverse = false)

(PHP 5 >=5.5.0)
Convert string from one charset to anothe

array|string|int|null
fromUCallback(int $reason, string $source, string $codePoint, int $error)

(PHP 5 >=5.5.0)
Default "from" callback function

static array|false|null
getAliases(string $name)

(PHP 5 >=5.5.0)
Get the aliases of the given name

static array
getAvailable()

(PHP 5 >=5.5.0)
Get the available canonical converter names

string|false|null
getDestinationEncoding()

(PHP 5 >=5.5.0)
Get the destination encoding

int|false|null
getDestinationType()

(PHP 5 >=5.5.0)
Get the destination converter type

int
getErrorCode()

(PHP 5 >=5.5.0)
Get last error code on the object

string|null
getErrorMessage()

(PHP 5 >=5.5.0)
Get last error message on the object

string|false|null
getSourceEncoding()

(PHP 5 >=5.5.0)
Get the source encoding

int|false|null
getSourceType()

(PHP 5 >=5.5.0)
Get the source convertor type

static array|null
getStandards()

(PHP 5 >=5.5.0)
Get standards associated to converter names

string|false|null
getSubstChars()

(PHP 5 >=5.5.0)
Get substitution chars

static string
reasonText(int $reason)

(PHP 5 >=5.5.0)
Get string representation of the callback reason

bool
setDestinationEncoding(string $encoding)

(PHP 5 >=5.5.0)
Set the destination encoding

bool
setSourceEncoding(string $encoding)

(PHP 5 >=5.5.0)
Set the source encoding

bool
setSubstChars(string $chars)

(PHP 5 >=5.5.0)
Set the substitution chars

array|string|int|null
toUCallback(int $reason, string $source, string $codeUnits, int $error)

(PHP 5 >=5.5.0)
Default "to" callback function

static string|false
transcode(string $str, string $toEncoding, string $fromEncoding, array|null $options = null)

(PHP 5 >=5.5.0)
Convert string from one charset to another

Details

__construct(string $destination_encoding = null, string $source_encoding = null)

(PHP 5 >=5.5.0)
Create UConverter object

Parameters

string $destination_encoding
string $source_encoding

string|false convert(string $str, bool $reverse = false)

(PHP 5 >=5.5.0)
Convert string from one charset to anothe

Parameters

string $str
bool $reverse [optional]

Return Value

string|false

array|string|int|null fromUCallback(int $reason, string $source, string $codePoint, int $error)

(PHP 5 >=5.5.0)
Default "from" callback function

Parameters

int $reason
string $source
string $codePoint
int $error

Return Value

array|string|int|null

static array|false|null getAliases(string $name)

(PHP 5 >=5.5.0)
Get the aliases of the given name

Parameters

string $name

Return Value

array|false|null

static array getAvailable()

(PHP 5 >=5.5.0)
Get the available canonical converter names

Return Value

array

string|false|null getDestinationEncoding()

(PHP 5 >=5.5.0)
Get the destination encoding

Return Value

string|false|null

int|false|null getDestinationType()

(PHP 5 >=5.5.0)
Get the destination converter type

Return Value

int|false|null

int getErrorCode()

(PHP 5 >=5.5.0)
Get last error code on the object

Return Value

int

string|null getErrorMessage()

(PHP 5 >=5.5.0)
Get last error message on the object

Return Value

string|null

string|false|null getSourceEncoding()

(PHP 5 >=5.5.0)
Get the source encoding

Return Value

string|false|null

int|false|null getSourceType()

(PHP 5 >=5.5.0)
Get the source convertor type

Return Value

int|false|null

static array|null getStandards()

(PHP 5 >=5.5.0)
Get standards associated to converter names

Return Value

array|null

string|false|null getSubstChars()

(PHP 5 >=5.5.0)
Get substitution chars

Return Value

string|false|null

static string reasonText(int $reason)

(PHP 5 >=5.5.0)
Get string representation of the callback reason

Parameters

int $reason

Return Value

string

bool setDestinationEncoding(string $encoding)

(PHP 5 >=5.5.0)
Set the destination encoding

Parameters

string $encoding

Return Value

bool

bool setSourceEncoding(string $encoding)

(PHP 5 >=5.5.0)
Set the source encoding

Parameters

string $encoding

Return Value

bool

bool setSubstChars(string $chars)

(PHP 5 >=5.5.0)
Set the substitution chars

Parameters

string $chars

Return Value

bool

array|string|int|null toUCallback(int $reason, string $source, string $codeUnits, int $error)

(PHP 5 >=5.5.0)
Default "to" callback function

Parameters

int $reason
string $source
string $codeUnits
int $error

Return Value

array|string|int|null

static string|false transcode(string $str, string $toEncoding, string $fromEncoding, array|null $options = null)

(PHP 5 >=5.5.0)
Convert string from one charset to another

Parameters

string $str
string $toEncoding
string $fromEncoding
array|null $options

Return Value

string|false