1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-28 22:50:07 +03:00

example: Fix indentation in icu.c, mention in NEWS

This commit is contained in:
Nick Wellnhofer 2024-11-22 20:24:02 +01:00
parent 4e27bbddfa
commit ec909ed27e
2 changed files with 12 additions and 8 deletions

4
NEWS
View File

@ -22,6 +22,10 @@ The serialization API will now take user-provided or default encodings
into account when serializing attribute values, matching the
serialization of text and avoiding unnecessary escaping.
An API function to install a custom character encoding converter is
now available. This makes it possible to use ICU for encoding conversion
even if libxml2 was complied without ICU support, see example/icu.c.
Access to many public struct members is now deprecated. Several accessor
functions were added.

View File

@ -22,12 +22,12 @@
#define ICU_PIVOT_BUF_SIZE 1024
typedef struct {
UConverter *uconv; /* for conversion between an encoding and UTF-16 */
UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
UChar *pivot_source;
UChar *pivot_target;
int isInput;
UChar pivot_buf[ICU_PIVOT_BUF_SIZE];
UConverter *uconv; /* for conversion between an encoding and UTF-16 */
UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
UChar *pivot_source;
UChar *pivot_target;
int isInput;
UChar pivot_buf[ICU_PIVOT_BUF_SIZE];
} myConvCtxt;
static int
@ -129,11 +129,11 @@ icuOpen(const char* name, int isInput, myConvCtxt **out)
status = U_ZERO_ERROR;
if (isInput) {
ucnv_setToUCallBack(cd->uconv, UCNV_TO_U_CALLBACK_STOP,
NULL, NULL, NULL, &status);
NULL, NULL, NULL, &status);
}
else {
ucnv_setFromUCallBack(cd->uconv, UCNV_FROM_U_CALLBACK_STOP,
NULL, NULL, NULL, &status);
NULL, NULL, NULL, &status);
}
if (U_FAILURE(status))
goto error;