ADC Home > Reference Library > Reference > Darwin > Miscellaneous User Space API Reference

 


encoding.h

Includes:

Introduction



Typedefs


xmlCharEncodingInputFunc


typedef int (*xmlCharEncodingInputFunc)(
    unsigned char *out,
    int *outlen, 
    const unsigned char *in,
    int *inlen);  
Discussion

xmlCharEncodingInputFunc: @out: a pointer to an array of bytes to store the UTF-8 result @outlen: the length of @out @in: a pointer to an array of chars in the original encoding @inlen: the length of @in

Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out.

Returns the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets consumed.


xmlCharEncodingOutputFunc


typedef int (*xmlCharEncodingOutputFunc)(
    unsigned char *out,
    int *outlen, 
    const unsigned char *in,
    int *inlen);  
Discussion

xmlCharEncodingOutputFunc: @out: a pointer to an array of bytes to store the result @outlen: the length of @out @in: a pointer to an array of UTF-8 chars @inlen: the length of @in

Take a block of UTF-8 chars in and try to convert it to another encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.

Returns the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets produced.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.
Last Updated: 2006-06-20