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 Scott Morgan <bl...@blueyonder.co.uk> on 2005/04/20 17:45:32 UTC

Base64::decode to XMLCh* - why?

It makes no sense to me, Base 64 is for encoding binary data, when you 
decode it (regardless of whether the encoded source is in UTF16 (i.e. 
from a parsed XML file DOMNode) or ASCII form) the output should be bytes.

But the decode method that takes XMLCh* as it's source returns XMLCh* so 
that {0x01, 0x02, 0x03} becomes (0x01, 0x00, 0x02, 0x00, 0x03, 0x00 }. 
You have to transliterate the encoded data down to ASCII form to send to 
the XMLByte* decode method which seems a bit pointless.

Is this a bug or am I missing something?

Scott Morgan


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Base64::decode to XMLCh* - why?

Posted by Scott Morgan <bl...@blueyonder.co.uk>.
Thanks for that.

Scott Morgan

david_n_bertoni@us.ibm.com wrote:

>Yes, it's just in CVS, although it looks like you could pull the latest 
>versions of Base64.cpp and Base64.hpp into 2.6.0 without any conflicts.
>
>Dave
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Base64::decode to XMLCh* - why?

Posted by da...@us.ibm.com.
Yes, it's just in CVS, although it looks like you could pull the latest 
versions of Base64.cpp and Base64.hpp into 2.6.0 without any conflicts.

Dave

> Ah, is that in CVS? I'm not seeing it anywhere in the 2.6.0 release.
> 
> Scott Morgan
> 
> David Cargill wrote:
> 
> >Hi Scott,
> >Trying using decodeToXMLByte instead of decode.
> >
> >Regards,
> >David A. Cargill
> >XML Parser Development
> >IBM Toronto Lab
> >(905) 413-2371, tie 969
> >cargilld@ca.ibm.com

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Base64::decode to XMLCh* - why?

Posted by Scott Morgan <bl...@blueyonder.co.uk>.
Ah, is that in CVS? I'm not seeing it anywhere in the 2.6.0 release.

Scott Morgan

David Cargill wrote:

>Hi Scott,
>Trying using decodeToXMLByte instead of decode.
>
>Regards,
>David A. Cargill
>XML Parser Development
>IBM Toronto Lab
>(905) 413-2371, tie 969
>cargilld@ca.ibm.com
>
>
>                                                                           
>             Scott Morgan                                                  
>             <blumf@blueyonder                                             
>             .co.uk>                                                    To 
>                                       c-dev@xerces.apache.org             
>             04/20/2005 11:45                                           cc 
>             AM                                                            
>                                                                   Subject 
>                                       Base64::decode to XMLCh* - why?     
>             Please respond to                                             
>                   c-dev                                                   
>                                                                           
> 
>
>It makes no sense to me, Base 64 is for encoding binary data, when you
>decode it (regardless of whether the encoded source is in UTF16 (i.e.
>from a parsed XML file DOMNode) or ASCII form) the output should be bytes.
>
>But the decode method that takes XMLCh* as it's source returns XMLCh* so
>that {0x01, 0x02, 0x03} becomes (0x01, 0x00, 0x02, 0x00, 0x03, 0x00 }.
>You have to transliterate the encoded data down to ASCII form to send to
>the XMLByte* decode method which seems a bit pointless.
>
>Is this a bug or am I missing something?
>
>Scott Morgan
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Base64::decode to XMLCh* - why?

Posted by David Cargill <ca...@ca.ibm.com>.
Hi Scott,
Trying using decodeToXMLByte instead of decode.

Regards,
David A. Cargill
XML Parser Development
IBM Toronto Lab
(905) 413-2371, tie 969
cargilld@ca.ibm.com


                                                                           
             Scott Morgan                                                  
             <blumf@blueyonder                                             
             .co.uk>                                                    To 
                                       c-dev@xerces.apache.org             
             04/20/2005 11:45                                           cc 
             AM                                                            
                                                                   Subject 
                                       Base64::decode to XMLCh* - why?     
             Please respond to                                             
                   c-dev                                                   
                                                                           
                                                                           
                                                                           
                                                                           




It makes no sense to me, Base 64 is for encoding binary data, when you
decode it (regardless of whether the encoded source is in UTF16 (i.e.
from a parsed XML file DOMNode) or ASCII form) the output should be bytes.

But the decode method that takes XMLCh* as it's source returns XMLCh* so
that {0x01, 0x02, 0x03} becomes (0x01, 0x00, 0x02, 0x00, 0x03, 0x00 }.
You have to transliterate the encoded data down to ASCII form to send to
the XMLByte* decode method which seems a bit pointless.

Is this a bug or am I missing something?

Scott Morgan


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org