[xml] Using the encoders

Date view Thread view Subject view Author view

From: Lutz Behnke (behnke@trustcenter.de)
Date: Wed Feb 09 2000 - 09:34:57 EST


Hi there,

I am currently trying to write a DOMHASH signing and verification implementation
for libxml. Now I have some questions:

a) Is there such an implement for/in libxml allready done? I could only find that
   sneak-ware java thingy from IBM.
b) if not, how can I use the encoding functions from libxml. I need to get the
   names and contents of the elements in UTF-16BE. I currently would understand the code
   to be something like (for the name of the element):

        xmlCharEncodingHandler utf16_handler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_UTF16BE);

        utf16_handler->xmlCharEncodingOutputFunc(node->name, strlen(node->name),
                                                (utf16_name, some_guessed_value);

   this is under the assumption that the name and CDATA is stored in allmost UTF-8
   (plain ASCII to be exact)
   Is that correct? Is the fact that the data is in UTF-8/ASCII ensured by the library?
   What happens when I present a full blown unicode document to libxml?

c) How can I compute the neccesary lenght of the output buffer. Wouldn't be a good thing
   for the function to return the _needed_ bytes if I call it with a output buffer of NULL.

mfg lutz

-- 
Lutz Behnke, TC TrustCenter GmbH
Sonninstrasse 24-28, D-20097 Hamburg, Germany
Tel:040/80 80 26-0  Fax:040/80 80 26-1 26   http://www.trustcenter.de
-----BEGIN GEEK CODE BLOCK-----
 Version: 3.1  
GCS/IT d- s+:+ a C++ ULS+++$ P+++ L+++ E+++ W++ !N o? k? !w@++ !O
!M !V PS+ PE Y+ PGP t+ 5+ X R+ tv+ b+++ DI+++ D G++ e++ h* r y+  
------END GEEK CODE BLOCK------

----
Message from the list xml@xmlsoft.org
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:01 EDT