classes-Com-Tecnick-Unicode-Convert

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

Com\Tecnick\Unicode\Convert

Tags
since
2015-07-13
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2011-2015 Nicola Asuni - Tecnick.com LTD

license

http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)

link
https://github.com/tecnickcom/tc-lib-unicode

Table of Contents

chr()  : string
Returns the unicode string containing the character specified by value
chrArrToOrdArr()  : array<string|int, mixed>
Converts an array of UTF-8 chars to an array of codepoints (integer values)
getSubUniArrStr()  : string
Extract a slice of the $uniarr array and return it as string
hexToStr()  : string
Convert an hexadecimal string (byte string - as in the PDF standard) to string
latinArrToStr()  : string
Converts an array of Latin1 code points to a string
ord()  : string
Returns the unicode value of the specified character
ordArrToChrArr()  : array<string|int, mixed>
Converts an array of UTF-8 code points array of chars
strToChrArr()  : array<string|int, mixed>
Converts an UTF-8 string to an array of UTF-8 codepoints (integer values)
strToHex()  : string
Convert a string to an hexadecimal string (byte string) representation (as in the PDF standard)
strToOrdArr()  : array<string|int, mixed>
Converts an UTF-8 string to an array of UTF-8 codepoints (integer values)
toUTF16BE()  : string
Converts an UTF-8 string to UTF-16BE
toUTF8()  : string
Converts a string with an unknown encoding to UTF-8
uniArrToLatinArr()  : array<string|int, mixed>
Converts UTF-8 code array to Latin1 codes

Methods

chr()

Returns the unicode string containing the character specified by value

public chr(int $ord) : string
Parameters
$ord : int

Unicode character value to convert

Return values
string

Returns the unicode string

chrArrToOrdArr()

Converts an array of UTF-8 chars to an array of codepoints (integer values)

public chrArrToOrdArr(array<string|int, mixed> $chars) : array<string|int, mixed>
Parameters
$chars : array<string|int, mixed>

Array of UTF-8 chars

Return values
array<string|int, mixed>

getSubUniArrStr()

Extract a slice of the $uniarr array and return it as string

public getSubUniArrStr(array<string|int, mixed> $uniarr, int $start[, int $end = null ]) : string
Parameters
$uniarr : array<string|int, mixed>

The input array of characters

$start : int

The position of the starting element

$end : int = null

The position of the first element that will not be returned.

Return values
string

hexToStr()

Convert an hexadecimal string (byte string - as in the PDF standard) to string

public hexToStr(mixed $hex) : string
Parameters
$hex : mixed
Return values
string

latinArrToStr()

Converts an array of Latin1 code points to a string

public latinArrToStr(array<string|int, mixed> $latarr) : string
Parameters
$latarr : array<string|int, mixed>

Array of Latin1 code points

Return values
string

ord()

Returns the unicode value of the specified character

public ord(string $chr) : string
Parameters
$chr : string

Unicode character

Return values
string

Returns the unicode value

ordArrToChrArr()

Converts an array of UTF-8 code points array of chars

public ordArrToChrArr(array<string|int, mixed> $ords) : array<string|int, mixed>
Parameters
$ords : array<string|int, mixed>

Array of UTF-8 code points

Return values
array<string|int, mixed>

strToChrArr()

Converts an UTF-8 string to an array of UTF-8 codepoints (integer values)

public strToChrArr(string $str) : array<string|int, mixed>
Parameters
$str : string

String to convert

Return values
array<string|int, mixed>

strToHex()

Convert a string to an hexadecimal string (byte string) representation (as in the PDF standard)

public strToHex(string $str) : string
Parameters
$str : string

String to convert

Return values
string

strToOrdArr()

Converts an UTF-8 string to an array of UTF-8 codepoints (integer values)

public strToOrdArr(string $str) : array<string|int, mixed>
Parameters
$str : string

Convert to convert

Return values
array<string|int, mixed>

toUTF16BE()

Converts an UTF-8 string to UTF-16BE

public toUTF16BE(string $str) : string
Parameters
$str : string

UTF-8 String to convert

Return values
string

UTF-16BE encoded string

toUTF8()

Converts a string with an unknown encoding to UTF-8

public toUTF8(string $str[, mixed $enc = null ]) : string
Parameters
$str : string

String to convert

$enc : mixed = null

Array or comma separated list string of encodings

Return values
string

UTF-8 encoded string

uniArrToLatinArr()

Converts UTF-8 code array to Latin1 codes

public uniArrToLatinArr(array<string|int, mixed> $ordarr) : array<string|int, mixed>
Parameters
$ordarr : array<string|int, mixed>

Array containing UTF-8 code points

Return values
array<string|int, mixed>
 

© 2004-2021 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy