Wednesday, January 7, 2009

UUEncoding and UUDecoding

convert_uuencode() function


This function encodes a string using the Unix-to-Unix encoding algorith.


syntax: convert_uuencode(string);

string – the input string

convert_uudecode() function

This function decodes a UU Encoded string.


snytax: convert_uudecode(string);

string – the encoded string

Example input:

$str = "This is Vince";
echo $str;
echo "";
echo convert_uuencode($str);
echo "";
echo convert_uudecode($encstr);

Example output:
This is Vince -5&AI

r!6:6yc90``>

Sunday, October 26, 2008

The convert_cyr_string() function

This function converts a string in one Cyrillic character set to another.

syntax: convert_cyr_string(string,from,to);

from – the character set from which the string should be converted.
to – the character set to which the string should be converted.

The from and two parameters can hold the following any of the following values.

k - koi8-r
w - windows-1251
i - iso8859-5
a - x-cp866
d - x-cp866
m - x-mac-cyrillic


Example input:

$str = "This is Vince æøå";
echo $str;
echo "
";
echo convert_cyr_string($str,'w','a');

Example output:

This is Vince æøå
This is Vince ¦è¥