ucnv_err.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
*
* ucnv_err.h:
*/
#ifndef UCNV_ERR_H
#define UCNV_ERR_H
#include "unicode/utypes.h"
#if !UCONFIG_NO_CONVERSION
struct UConverter;
typedef struct UConverter UConverter;
#define UCNV_SUB_STOP_ON_ILLEGAL "i"
#define UCNV_SKIP_STOP_ON_ILLEGAL "i"
#define UCNV_ESCAPE_ICU NULL
#define UCNV_ESCAPE_JAVA "J"
#define UCNV_ESCAPE_C "C"
#define UCNV_ESCAPE_XML_DEC "D"
#define UCNV_ESCAPE_XML_HEX "X"
#define UCNV_ESCAPE_UNICODE "U"
#define UCNV_ESCAPE_CSS2 "S"
typedef enum {
UCNV_UNASSIGNED = 0,
UCNV_ILLEGAL = 1,
UCNV_IRREGULAR = 2,
UCNV_RESET = 3,
UCNV_CLOSE = 4,
UCNV_CLONE = 5
} UConverterCallbackReason;
typedef struct {
uint16_t size;
UBool flush;
UConverter *converter;
const UChar *source;
const UChar *sourceLimit;
char *target;
const char *targetLimit;
int32_t *offsets;
} UConverterFromUnicodeArgs;
typedef struct {
uint16_t size;
UBool flush;
UConverter *converter;
const char *source;
const char *sourceLimit;
UChar *target;
const UChar *targetLimit;
int32_t *offsets;
} UConverterToUnicodeArgs;
U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_STOP (
const void *context,
UConverterFromUnicodeArgs *fromUArgs,
const UChar* codeUnits,
int32_t length,
UChar32 codePoint,
UConverterCallbackReason reason,
UErrorCode * err);
U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP (
const void *context,
UConverterToUnicodeArgs *toUArgs,
const char* codeUnits,
int32_t length,
UConverterCallbackReason reason,
UErrorCode * err);
U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_SKIP (
const void *context,
UConverterFromUnicodeArgs *fromUArgs,
const UChar* codeUnits,
int32_t length,
UChar32 codePoint,
UConverterCallbackReason reason,
UErrorCode * err);
U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_SUBSTITUTE (
const void *context,
UConverterFromUnicodeArgs *fromUArgs,
const UChar* codeUnits,
int32_t length,
UChar32 codePoint,
UConverterCallbackReason reason,
UErrorCode * err);
U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_ESCAPE (
const void *context,
UConverterFromUnicodeArgs *fromUArgs,
const UChar* codeUnits,
int32_t length,
UChar32 codePoint,
UConverterCallbackReason reason,
UErrorCode * err);
U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_SKIP (
const void *context,
UConverterToUnicodeArgs *toUArgs,
const char* codeUnits,
int32_t length,
UConverterCallbackReason reason,
UErrorCode * err);
U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_SUBSTITUTE (
const void *context,
UConverterToUnicodeArgs *toUArgs,
const char* codeUnits,
int32_t length,
UConverterCallbackReason reason,
UErrorCode * err);
U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_ESCAPE (
const void *context,
UConverterToUnicodeArgs *toUArgs,
const char* codeUnits,
int32_t length,
UConverterCallbackReason reason,
UErrorCode * err);
#endif
#endif
/*UCNV_ERR_H*/
UConverterFromUnicodeArgs
The structure for the fromUnicode callback function parameter.
Definition: ucnv_err.h:194
UConverterFromUnicodeArgs::targetLimit
const char * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:201
UConverterFromUnicodeArgs::flush
UBool flush
The internal state of converter will be reset and data flushed if set to true.
Definition: ucnv_err.h:196
UConverterFromUnicodeArgs::source
const UChar * source
Pointer to the source source buffer.
Definition: ucnv_err.h:198
UConverterFromUnicodeArgs::offsets
int32_t * offsets
Pointer to the buffer that receives the offsets.
Definition: ucnv_err.h:202
UConverterFromUnicodeArgs::sourceLimit
const UChar * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:199
UConverterFromUnicodeArgs::size
uint16_t size
The size of this struct.
Definition: ucnv_err.h:195
UConverterFromUnicodeArgs::target
char * target
Pointer to the target buffer.
Definition: ucnv_err.h:200
UConverterFromUnicodeArgs::converter
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:197
UConverterToUnicodeArgs
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:210
UConverterToUnicodeArgs::targetLimit
const UChar * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:217
UConverterToUnicodeArgs::flush
UBool flush
The internal state of converter will be reset and data flushed if set to true.
Definition: ucnv_err.h:212
UConverterToUnicodeArgs::size
uint16_t size
The size of this struct.
Definition: ucnv_err.h:211
UConverterToUnicodeArgs::target
UChar * target
Pointer to the target buffer.
Definition: ucnv_err.h:216
UConverterToUnicodeArgs::converter
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:213
UConverterToUnicodeArgs::offsets
int32_t * offsets
Pointer to the buffer that receives the offsets.
Definition: ucnv_err.h:218
UConverterToUnicodeArgs::sourceLimit
const char * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:215
UConverterToUnicodeArgs::source
const char * source
Pointer to the source source buffer.
Definition: ucnv_err.h:214
UConverter
struct UConverter UConverter
Definition: ucnv_err.h:96
UCNV_FROM_U_CALLBACK_ESCAPE
U_CAPI void UCNV_FROM_U_CALLBACK_ESCAPE(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback will Substitute the ILLEGAL SEQUENCE w...
UConverterCallbackReason
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:157
UCNV_IRREGULAR
@ UCNV_IRREGULAR
The codepoint is not a regular sequence in the encoding.
Definition: ucnv_err.h:168
UCNV_ILLEGAL
@ UCNV_ILLEGAL
The code point is illegal.
Definition: ucnv_err.h:160
UCNV_RESET
@ UCNV_RESET
The callback is called with this reason when a 'reset' has occurred.
Definition: ucnv_err.h:173
UCNV_CLOSE
@ UCNV_CLOSE
Called when the converter is closed.
Definition: ucnv_err.h:176
UCNV_UNASSIGNED
@ UCNV_UNASSIGNED
The code point is unassigned.
Definition: ucnv_err.h:158
UCNV_CLONE
@ UCNV_CLONE
Called when ucnv_safeClone() is called on the converter.
Definition: ucnv_err.h:178
UCNV_TO_U_CALLBACK_SUBSTITUTE
U_CAPI void UCNV_TO_U_CALLBACK_SUBSTITUTE(const void *context, UConverterToUnicodeArgs *toUArgs, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback will Substitute the ILLEGAL SEQUENCE,...
UCNV_FROM_U_CALLBACK_SKIP
U_CAPI void UCNV_FROM_U_CALLBACK_SKIP(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback skips any ILLEGAL_SEQUENCE,...
UCNV_FROM_U_CALLBACK_STOP
U_CAPI void UCNV_FROM_U_CALLBACK_STOP(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback STOPS at the ILLEGAL_SEQUENCE,...
UCNV_FROM_U_CALLBACK_SUBSTITUTE
U_CAPI void UCNV_FROM_U_CALLBACK_SUBSTITUTE(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback will Substitute the ILLEGAL SEQUENCE,...
UCNV_TO_U_CALLBACK_STOP
U_CAPI void UCNV_TO_U_CALLBACK_STOP(const void *context, UConverterToUnicodeArgs *toUArgs, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback STOPS at the ILLEGAL_SEQUENCE,...
UCNV_TO_U_CALLBACK_SKIP
U_CAPI void UCNV_TO_U_CALLBACK_SKIP(const void *context, UConverterToUnicodeArgs *toUArgs, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback skips any ILLEGAL_SEQUENCE,...
UCNV_TO_U_CALLBACK_ESCAPE
U_CAPI void UCNV_TO_U_CALLBACK_ESCAPE(const void *context, UConverterToUnicodeArgs *toUArgs, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback will Substitute the ILLEGAL SEQUENCE wit...
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:435
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:247
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:386
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415