Share via


QEncode

Call this function to convert some data using the "Q" encoding.

inline BOOL QEncode( 
   BYTE* pbSrcData, 
   int nSrcLen, 
   LPSTR szDest, 
   int* pnDestLen, 
   LPCSTR pszCharSet, 
   int* pnNumEncoded = NULL  
) throw( );

Parameters

  • pbSrcData
    The buffer containing the data to be encoded.

  • nSrcLen
    The length in bytes of the data to be encoded.

  • szDest
    Caller-allocated buffer to receive the encoded data.

  • pnDestLen
    Pointer to a variable that contains the length in characters of szDest. If the function succeeds, the variable receives the number of characters written to the buffer. If the function fails, the variable receives the required length in characters of the buffer.

  • pszCharSet
    The character set to use for the conversion.

  • pnNumEncoded
    A pointer to a variable that on return contains the number of unsafe characters that had to be converted.

Return Value

Returns TRUE on success, FALSE on failure.

Remarks

The "Q" encoding scheme is described in RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt).

Requirements

Header: atlenc.h

See Also

Reference

QEncodeGetRequiredLength

Other Resources

ATL Concepts

ATL COM Desktop Components

ATL Functions Alphabetical Reference