\Pydio\Core\UtilsTextEncoder

Static utilitaries to encode/decode charset to/from utf8

Summary

Methods
Properties
Constants
updateContext()
changeCharset()
parseCharset()
getEncoding()
fromUTF8()
toUTF8()
isUtf8()
fromStorageEncoding()
toStorageEncoding()
$currentCharsetValue
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$context
N/A

Properties

$currentCharsetValue

$currentCharsetValue : 

Type

Methods

changeCharset()

changeCharset(string  $inputCharset, string  $outputCharset, string  $text) : string

Change the charset of a string from input to output

Parameters

string $inputCharset
string $outputCharset
string $text

Returns

string

parseCharset()

parseCharset(string  $locale) : string

Detect the current charset from the current locale

Parameters

string $locale

Returns

string

getEncoding()

getEncoding() : string

Try to detect the current encoding (cached in session)

Returns

string

fromUTF8()

fromUTF8(string  $filesystemElement, boolean  $test = false) : string

Decode a string from UTF8 to current Charset

Parameters

string $filesystemElement
boolean $test

Try to detect if it's really utf8 or not

Returns

string

toUTF8()

toUTF8(string  $filesystemElement, boolean  $test = true) : string

Transform a string from current charset to utf8

Parameters

string $filesystemElement
boolean $test

Test if it's already UTF8 or not, to avoid double-encoding

Returns

string

isUtf8()

isUtf8(string  $string) : boolean

Test if a string seem to be already UTF8-encoded

Parameters

string $string

Returns

boolean

fromStorageEncoding()

fromStorageEncoding(string  $filesystemElement, boolean  $test = true) : string

Transform a string from current Storage charset to utf8

Parameters

string $filesystemElement
boolean $test

Test if it's already UTF8 or not, to avoid double-encoding

Returns

string

toStorageEncoding()

toStorageEncoding(string  $filesystemElement, boolean  $test = false) : string

Decode a string from UTF8 to current Storage Charset

Parameters

string $filesystemElement
boolean $test

Try to detect if it's really utf8 or not

Returns

string