Uuencode / Uudecode for .NET or Visual C ++ 6.0?

I have uuencoded files and need to decode them using .NET 2.0 or Visual C ++ 6.0. Any good libraries / classes to help here? It looks like this is not built into .NET or MFC.

0


a source to share


3 answers


Try uudeview, here . It is an open source library that works well and will also handle yenc files in addition to uuencoded. You can use it from C / C ++ or write an interop wrapper for C # without too much trouble.



+1


a source


Code Project has .NET library + source code for uuencoding / decoding. The algorithm itself is widespread across the network and is quite short.

Project code link: http://www.codeproject.com/KB/security/TextCoDec.aspx



Brief introduction from the article:

This article introduces a class library for encoding / decoding files and / or text in multiple algorithms in .NET. Some functions of this library:

Encoding / decoding quoted text Files for encoding / decoding for printing and text in Base64 Encoding / decoding files and text in encoding / decoding UUEncode files in yEnc

+1


a source


I know this is an old question, but I thought I'd post my answer in case anyone else comes across it.

I wrote a streaming uuencoding injection for an encoder and decoder with extensive unit tests.

To decode any stream:

using (Stream encodedStream = /* Any readable stream. */)
using (Stream decodedStream = /* Any writeable stream. */)
using (var decodeStream = new UUDecodeStream(encodedStream))
{ 
    decodeStream.CopyTo(decodedStream);
    // Decoded contents are now in decodedStream.
}

      

To encode any stream:

bool unixLineEnding = // True if encoding with Unix line endings, otherwise false.
using (Stream encodedStream = /* Any readable stream. */)
using (Stream decodedStream = /* Any writeable stream. */)
using (var encodeStream = new UUEncodeStream(encodedStream, unixLineEnding))
{
    decodedStream.CopyTo(encodeStream);
    // Encoded contents are now in encodedStream.
}

      

+1


a source







All Articles