You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by on 2002/03/12 14:36:41 UTC
Base64 Problem
Hi,
i use Xerces 1.5.2 and have a problem using Base64.
I�ve written attached code, but it will not work.
It throws me this compile error:
error C2664: 'decode' : Konvertierung des Parameters 1 von 'unsigned
char [100]' in 'const unsigned short *const ' nicht moeglich
(Converting Param 1 from 'unsigned char[100]' to 'const unsigned
short *const ' not possible)
What is wrong and can you help?
-----------------------------
// Create new file
FILE *file_newfile;
file_newfile = fopen(cpNewFileName,"a");
// Open MIME
FILE *file_mime;
file_mime = fopen(cpMIMEFile,"r");
// Decode and write new file
XMLByte cBuffer[100];
XMLByte* cReturnBuffer;
int iRead, iWritten = 0;
while (!feof( file_mime ) )
{
// Read MIME coded
iRead = fread( cBuffer , sizeof(char) , 100 , file_mime );
// Decode
cReturnBuffer = Base64::decode(cBuffer,&iWritten);
// Write decoded
fwrite(cReturnBuffer,sizeof(char),100,file_newfile);
}
// Close Files
fclose( file_mime );
fclose( file_newfile );
// Finished
return E_NO_ERROR;
-----------------------------
http://www.mysc.de/index_antrag.php3?empf=mysc10026420
__________________________________________________
:-) kassiere f�r jede versandte eMail 2,5 Cent (-:
http://www.mysc.de --- http://www.mysc.at
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Base64 Problem
Posted by PeiYong PY Zhang <pe...@ca.ibm.com>.
Hi, there,
The XercesC1_7_0 has the new interface to encode/decode, please have
a try.
Rgds,
PeiYong
"paladin@mysc.de" wrote:
> Hi,
>
> i use Xerces 1.5.2 and have a problem using Base64.
> I´ve written attached code, but it will not work.
>
> It throws me this compile error:
> error C2664: 'decode' : Konvertierung des Parameters 1 von 'unsigned
> char [100]' in 'const unsigned short *const ' nicht moeglich
> (Converting Param 1 from 'unsigned char[100]' to 'const unsigned
> short *const ' not possible)
>
> What is wrong and can you help?
>
> -----------------------------
> // Create new file
>
> FILE *file_newfile;
> file_newfile = fopen(cpNewFileName,"a");
>
> // Open MIME
>
> FILE *file_mime;
> file_mime = fopen(cpMIMEFile,"r");
>
> // Decode and write new file
>
> XMLByte cBuffer[100];
> XMLByte* cReturnBuffer;
> int iRead, iWritten = 0;
>
> while (!feof( file_mime ) )
> {
>
> // Read MIME coded
>
> iRead = fread( cBuffer , sizeof(char) , 100 , file_mime );
>
> // Decode
>
> cReturnBuffer = Base64::decode(cBuffer,&iWritten);
>
> // Write decoded
>
> fwrite(cReturnBuffer,sizeof(char),100,file_newfile);
>
> }
>
> // Close Files
>
> fclose( file_mime );
> fclose( file_newfile );
>
> // Finished
>
> return E_NO_ERROR;
>
> -----------------------------
> http://www.mysc.de/index_antrag.php3?empf=mysc10026420
>
> __________________________________________________
> :-) kassiere für jede versandte eMail 2,5 Cent (-:
> http://www.mysc.de --- http://www.mysc.at
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org