FileAccess Orion

Iconv extends AbstractStringWrapper
in package

Table of Contents

$convertEncoding  : string|null
An optionally character encoding to convert to
$encoding  : string|null
The character encoding working on
$encodings  : array<string|int, string>
List of supported character sets (upper case)
__construct()  : mixed
Constructor
convert()  : string|false
Convert a string from defined encoding to the defined convert encoding
getConvertEncoding()  : string|null
Get the defined character encoding to convert to
getEncoding()  : string
Get the defined character encoding to work with
getSupportedEncodings()  : array<string|int, string>
Get a list of supported character encodings
isSupported()  : bool
Check if the given character encoding is supported by this wrapper and the character encoding to convert to is also supported.
setEncoding()  : StringWrapperInterface
Set character encoding working with and convert to
strlen()  : int|false
Returns the length of the given string
strPad()  : string
Pad a string to a certain length with another string
strpos()  : int|false
Find the position of the first occurrence of a substring in a string
substr()  : string|false
Returns the portion of string specified by the start and length parameters
wordWrap()  : string|false
Wraps a string to a given number of characters

Properties

$convertEncoding

An optionally character encoding to convert to

protected string|null $convertEncoding

$encodings

List of supported character sets (upper case)

protected static array<string|int, string> $encodings = [ // European languages 'ASCII', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-7', 'ISO-8859-9', 'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', 'KOI8-R', 'KOI8-U', 'KOI8-RU', 'CP1250', 'CP1251', 'CP1252', 'CP1253', 'CP1254', 'CP1257', 'CP850', 'CP866', 'CP1131', 'MACROMAN', 'MACCENTRALEUROPE', 'MACICELAND', 'MACCROATIAN', 'MACROMANIA', 'MACCYRILLIC', 'MACUKRAINE', 'MACGREEK', 'MACTURKISH', 'MACINTOSH', // Semitic languages 'ISO-8859-6', 'ISO-8859-8', 'CP1255', 'CP1256', 'CP862', 'MACHEBREW', 'MACARABIC', // Japanese 'EUC-JP', 'SHIFT_JIS', 'CP932', 'ISO-2022-JP', 'ISO-2022-JP-2', 'ISO-2022-JP-1', // Chinese 'EUC-CN', 'HZ', 'GBK', 'CP936', 'GB18030', 'EUC-TW', 'BIG5', 'CP950', 'BIG5-HKSCS', 'BIG5-HKSCS:2004', 'BIG5-HKSCS:2001', 'BIG5-HKSCS:1999', 'ISO-2022-CN', 'ISO-2022-CN-EXT', // Korean 'EUC-KR', 'CP949', 'ISO-2022-KR', 'JOHAB', // Armenian 'ARMSCII-8', // Georgian 'GEORGIAN-ACADEMY', 'GEORGIAN-PS', // Tajik 'KOI8-T', // Kazakh 'PT154', 'RK1048', // Thai 'ISO-8859-11', 'TIS-620', 'CP874', 'MACTHAI', // Laotian 'MULELAO-1', 'CP1133', // Vietnamese 'VISCII', 'TCVN', 'CP1258', // Platform specifics 'HP-ROMAN8', 'NEXTSTEP', // Full Unicode 'UTF-8', 'UCS-2', 'UCS-2BE', 'UCS-2LE', 'UCS-4', 'UCS-4BE', 'UCS-4LE', 'UTF-16', 'UTF-16BE', 'UTF-16LE', 'UTF-32', 'UTF-32BE', 'UTF-32LE', 'UTF-7', 'C99', 'JAVA', /* Commented out because that's internal encodings not existing in real world // Full Unicode, in terms of uint16_t or uint32_t (with machine dependent endianness and alignment) 'UCS-2-INTERNAL', 'UCS-4-INTERNAL', // Locale dependent, in terms of `char' or `wchar_t' (with machine dependent endianness and alignment, // and with OS and locale dependent semantics) 'char', 'wchar_t', '', // The empty encoding name is equivalent to "char": it denotes the locale dependent character encoding. */ // When configured with the option --enable-extra-encodings, // it also provides support for a few extra encodings: // European languages 'CP437', 'CP737', 'CP775', 'CP852', 'CP853', 'CP855', 'CP857', 'CP858', 'CP860', 'CP861', 'CP863', 'CP865', 'CP869', 'CP1125', // Semitic languages 'CP864', // Japanese 'EUC-JISX0213', 'Shift_JISX0213', 'ISO-2022-JP-3', // Chinese 'BIG5-2003', // (experimental) // Turkmen 'TDS565', // Platform specifics 'ATARIST', 'RISCOS-LATIN1', ]
Tags
link
http://www.gnu.org/software/libiconv/

Methods

convert()

Convert a string from defined encoding to the defined convert encoding

public convert(string $str[, bool $reverse = false ]) : string|false
Parameters
$str : string
$reverse : bool = false
Return values
string|false

getConvertEncoding()

Get the defined character encoding to convert to

public getConvertEncoding() : string|null
Return values
string|null

getEncoding()

Get the defined character encoding to work with

public getEncoding() : string
Tags
throws
LogicException

If no encoding was defined

Return values
string

getSupportedEncodings()

Get a list of supported character encodings

public static getSupportedEncodings() : array<string|int, string>
Return values
array<string|int, string>

isSupported()

Check if the given character encoding is supported by this wrapper and the character encoding to convert to is also supported.

public static isSupported(string $encoding[, string|null $convertEncoding = null ]) : bool
Parameters
$encoding : string
$convertEncoding : string|null = null
Return values
bool

setEncoding()

Set character encoding working with and convert to

public setEncoding(string $encoding[, string|null $convertEncoding = null ]) : StringWrapperInterface
Parameters
$encoding : string

The character encoding to work with

$convertEncoding : string|null = null

The character encoding to convert to

Return values
StringWrapperInterface

strlen()

Returns the length of the given string

public strlen(string $str) : int|false
Parameters
$str : string
Return values
int|false

strPad()

Pad a string to a certain length with another string

public strPad(string $input, int $padLength[, string $padString = ' ' ][, int $padType = STR_PAD_RIGHT ]) : string
Parameters
$input : string
$padLength : int
$padString : string = ' '
$padType : int = STR_PAD_RIGHT
Return values
string

strpos()

Find the position of the first occurrence of a substring in a string

public strpos(string $haystack, string $needle, int $offset) : int|false
Parameters
$haystack : string
$needle : string
$offset : int
Return values
int|false

substr()

Returns the portion of string specified by the start and length parameters

public substr(string $str, int $offset[, int|null $length = null ]) : string|false
Parameters
$str : string
$offset : int
$length : int|null = null
Return values
string|false

wordWrap()

Wraps a string to a given number of characters

public wordWrap(string $string[, int $width = 75 ][, string $break = " " ][, bool $cut = false ]) : string|false
Parameters
$string : string
$width : int = 75
$break : string = " "
$cut : bool = false
Return values
string|false

Search results