I'm trying to make my own $encode/$decode identifiers. for bordoms sake..

I'm using the method outlined @ http://dictionary.reference.com/search?q=uuencode
It all works ok, exept for occasionaly it drops the last letter when you "reencode" it, because it doesnt have any ` (s) on the end.
ANyone have an idea of how to work out how many ` (s) go on the end of the encoded text?

ie $encode(poo) would be #<&]O````