Encoding
in package
Com\Tecnick\Unicode\Convert\Encoding
Tags
Table of Contents
Methods
- 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
- strToHex() : string
- Convert a string to an hexadecimal string (byte string) representation (as in the PDF standard)
- 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, int>
- Converts UTF-8 code array to Latin1 codes
Methods
hexToStr()
Convert an hexadecimal string (byte string - as in the PDF standard) to string
public hexToStr(string $hex)
: string
Parameters
- $hex : string
-
Hex code to convert
Return values
stringlatinArrToStr()
Converts an array of Latin1 code points to a string
public latinArrToStr(array<string|int,
int> $latarr)
: string
Parameters
- $latarr : array<string|int, int>
-
Array of Latin1 code points
Return values
stringstrToHex()
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
stringtoUTF16BE()
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[,
null|string|array<string|int,
string> $enc
= null
]) : string
Parameters
- $str : string
-
String to convert
- $enc : null|string|array<string|int, string> = 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,
int> $ordarr)
: array<string|int,
int>
Parameters
- $ordarr : array<string|int, int>
-
Array containing UTF-8 code points
Return values
array<string|int, int> —Array containing Latin1 code points