Function type xmlCharEncodingInputFunc
int xmlCharEncodingInputFunc (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen)
Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out.
| 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 |
| 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. |
Function type xmlCharEncodingOutputFunc
int xmlCharEncodingOutputFunc (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen)
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.
| 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 |
| 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. |
UTF8Toisolat1 ()
int UTF8Toisolat1 (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen)
Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.
| 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 |
| Returns: |
the number of bytes written or an XML_ENC_ERR code. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced. |
isolat1ToUTF8 ()
int isolat1ToUTF8 (unsigned char * out,
int * outlen,
const unsigned char * in,
int * inlen)
Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.
| out: |
a pointer to an array of bytes to store the result |
| outlen: |
the length of @out |
| in: |
a pointer to an array of ISO Latin 1 chars |
| inlen: |
the length of @in |
| Returns: |
the number of bytes written or an XML_ENC_ERR code. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced. |
xmlAddEncodingAlias ()
int xmlAddEncodingAlias (const char * name,
const char * alias)
Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.
| name: |
the encoding name as parsed, in UTF-8 format (ASCII actually) |
| alias: |
the alias name as parsed, in UTF-8 format (ASCII actually) |
| Returns: |
0 in case of success, -1 in case of error |
xmlCharEncCloseFunc ()
int xmlCharEncCloseFunc (xmlCharEncodingHandler * handler)
Generic front-end for encoding handler close function
| handler: |
char encoding transformation data structure |
| Returns: |
0 if success, or -1 in case of error |
xmlCharEncInFunc ()
int xmlCharEncInFunc (xmlCharEncodingHandler * handler,
xmlBufferPtr out,
xmlBufferPtr in)
Generic front-end for the encoding handler input function
| handler: |
char encoding transformation data structure |
| out: |
an xmlBuffer for the output. |
| in: |
an xmlBuffer for the input |
| Returns: |
the number of bytes written or an XML_ENC_ERR code. |
xmlCharEncOutFunc ()
int xmlCharEncOutFunc (xmlCharEncodingHandler * handler,
xmlBufferPtr out,
xmlBufferPtr in)
Generic front-end for the encoding handler output function a first call with @in == NULL has to be made firs to initiate the output in case of non-stateless encoding needing to initiate their state or the output (like the BOM in UTF16). In case of UTF8 sequence conversion errors for the given encoder, the content will be automatically remapped to a CharRef sequence.
| handler: |
char encoding transformation data structure |
| out: |
an xmlBuffer for the output. |
| in: |
an xmlBuffer for the input |
| Returns: |
the number of bytes written or an XML_ENC_ERR code. |
xmlCleanupCharEncodingHandlers ()
void xmlCleanupCharEncodingHandlers (void)
DEPRECATED: This function will be made private. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all. Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases.
xmlCleanupEncodingAliases ()
void xmlCleanupEncodingAliases (void)
Unregisters all aliases
xmlDelEncodingAlias ()
int xmlDelEncodingAlias (const char * alias)
Unregisters an encoding alias @alias
| alias: |
the alias name as parsed, in UTF-8 format (ASCII actually) |
| Returns: |
0 in case of success, -1 in case of error |
xmlDetectCharEncoding ()
xmlCharEncoding xmlDetectCharEncoding (const unsigned char * in,
int len)
Guess the encoding of the entity using the first bytes of the entity content according to the non-normative appendix F of the XML-1.0 recommendation.
| in: |
a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). |
| len: |
pointer to the length of the buffer |
| Returns: |
one of the XML_CHAR_ENCODING_... values. |
xmlFindCharEncodingHandler ()
xmlCharEncodingHandlerPtr xmlFindCharEncodingHandler (const char * name)
DEPRECATED: Use xmlOpenCharEncodingHandler which has better error reporting.
| name: |
a string describing the char encoding. |
| Returns: |
the handler or NULL if no handler was found or an error occurred. |
xmlGetCharEncodingName ()
const char * xmlGetCharEncodingName (xmlCharEncoding enc)
The "canonical" name for XML encoding. C.f. http://www.w3.org/TR/REC-xml#charencoding Section 4.3.3 Character Encoding in Entities
| enc: |
the encoding |
| Returns: |
the canonical name for the given encoding |
xmlGetEncodingAlias ()
const char * xmlGetEncodingAlias (const char * alias)
Lookup an encoding name for the given alias.
| alias: |
the alias name as parsed, in UTF-8 format (ASCII actually) |
| Returns: |
NULL if not found, otherwise the original name |
xmlInitCharEncodingHandlers ()
void xmlInitCharEncodingHandlers (void)
DEPRECATED: Alias for xmlInitParser.
xmlLookupCharEncodingHandler ()
int xmlLookupCharEncodingHandler (xmlCharEncoding enc,
xmlCharEncodingHandler ** out)
Find or create a handler matching the encoding. If no default or registered handler could be found, try to create a handler using iconv or ICU if supported. The handler must be closed with xmlCharEncCloseFunc. Available since 2.13.0.
xmlOpenCharEncodingHandler ()
int xmlOpenCharEncodingHandler (const char * name,
int output,
xmlCharEncodingHandler ** out)
Find or create a handler matching the encoding. If no default or registered handler could be found, try to create a handler using iconv or ICU if supported. The handler must be closed with xmlCharEncCloseFunc. Available since 2.13.0.
| name: |
a string describing the char encoding. |
| output: |
boolean, use handler for output |
| out: |
pointer to result |
| Returns: |
an xmlParserErrors error code. |
xmlParseCharEncoding ()
xmlCharEncoding xmlParseCharEncoding (const char * name)
Compare the string to the encoding schemes already known. Note that the comparison is case insensitive accordingly to the section [XML] 4.3.3 Character Encoding in Entities.
| name: |
the encoding name as parsed, in UTF-8 format (ASCII actually) |
| Returns: |
one of the XML_CHAR_ENCODING_... values or XML_CHAR_ENCODING_NONE if not recognized. |
xmlRegisterCharEncodingHandler ()
void xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler)
Register the char encoding handler, surprising, isn't it ?