Core Function UUEncode
From Sputnik Wiki
UUEncode( <expression> )
Contents |
Description
Encodes a string using the uuencode algorithm.
Uuencode translates all strings (including binary's ones) into printable characters, making them safe for network transmissions.
Uuencoded data is about 35% larger than the original.
Parameters
expression
The data to be encoded.
Can be a string or binary variable.
If it is neither of the above it will be converted into a string and used anyway.
Return Value
Success: Returns the uuencoded data
Failure: Returns empty string.
Remarks
This function produces results that are equal to PHPs.
If you require results equal to Perl try the UUEncode found on the Pack( ) function.
Example
echo UUEncode("Testy"); # Prints: # %5&5S='D` # `
Perl compatible UUEncode a string
echo PerlUUEncode("Testy"); # Prints: %5&5S='D` Function PerlUUEncode ( $str ) { return (string)pack("u", $str); } # Notice this Perl compatible one produces a slightly # different text to the one above? Of course both are # valid and Unpack() will read both the Perl/PHP styles # with no problem