\Horde_ActiveSync_Utils

Horde_ActiveSync_Utils:: contains general utilities.

Summary

Methods
Properties
Constants
decodeBase64()
getUidFromGoid()
createGoid()
ensureUtf8()
No public properties found
No constants found
_stripNon7BitChars()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

decodeBase64()

decodeBase64(  $uri) : array

Decode a base64 encoded URI

Parameters

$uri

Returns

array —

The decoded request

createGoid()

createGoid(string  $uid,   $options = array()) : string

Create a MAPI GOID from a UID See http://msdn.microsoft.com/en-us/library/ee157690%28v=exchg.80%29

Parameters

string $uid

The UID value to encode.

$options

Returns

string —

A Base64 encoded GOID

ensureUtf8()

ensureUtf8(string  $data, string  $from_charset) : string

Ensure $data is converted to valid UTF-8 data. Works as follows: Converts to UTF-8, assuming data is in $from_charset encoding. If that produces invalid UTF-8, attempt to convert to most common mulitibyte encodings. If that *still* fails, strip out non 7-Bit characters.

..and force encoding to UTF-8 from $from_charset as a last resort.

Parameters

string $data

The string data to convert to UTF-8.

string $from_charset

The character set to assume $data is encoded in.

Returns

string —

A valid UTF-8 encoded string.

_stripNon7BitChars()

_stripNon7BitChars(string  $text) : string|boolean

Strip out non 7Bit characters from a text string.

Parameters

string $text

The string to strip.

Returns

string|boolean —

The stripped string, or false if failed.