Click here to Skip to main content
15,896,118 members
Articles / Programming Languages / C++

AMMimeUtils

Rate me:
Please Sign up or sign in to vote.
3.24/5 (10 votes)
13 Jun 2001 139.3K   1.6K   25  
An article on how to decode Base64 and Quoted-Printable text without using MFC.
//decodes a single line from a header-field in a mail...
char* MimeDecodeMailHeaderField(char *s);

//class to handle all base64 stuff...
class CBase64Utils
{
private:
  int ErrorCode;
public:
  int GetLastError() {return ErrorCode;};
	CBase64Utils();
	~CBase64Utils();
  char* Decode(char *input, int *bufsize); //caller must free the result, bufsize holds the decoded length
  char* Encode(char *input, int bufsize); //caller must free the result, bufsize is the length of the input buffer
};

//class to handle quoted-printable stuff
class CQPUtils
{
private:
  char* ExpandBuffer(char *buffer, int UsedSize, int *BufSize, bool SingleChar = true);
  int ErrorCode;
public:
  int GetLastError() {return ErrorCode;};
	char* Decode(char *input); //caller must free the result
  char* Encode(char *input); //caller must free the result
	CQPUtils();
	~CQPUtils();
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
Denmark Denmark
Huh! Wink | ;-)

Comments and Discussions