ICU 65.1  65.1
ucnv.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 **********************************************************************
5 * Copyright (C) 1999-2014, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
8  * ucnv.h:
9  * External APIs for the ICU's codeset conversion library
10  * Bertrand A. Damiba
11  *
12  * Modification History:
13  *
14  * Date Name Description
15  * 04/04/99 helena Fixed internal header inclusion.
16  * 05/11/00 helena Added setFallback and usesFallback APIs.
17  * 06/29/2000 helena Major rewrite of the callback APIs.
18  * 12/07/2000 srl Update of documentation
19  */
20 
49 #ifndef UCNV_H
50 #define UCNV_H
51 
52 #include "unicode/ucnv_err.h"
53 #include "unicode/uenum.h"
54 #include "unicode/localpointer.h"
55 
56 #if !defined(USET_DEFINED) && !defined(U_IN_DOXYGEN)
57 
58 #define USET_DEFINED
59 
68 typedef struct USet USet;
69 
70 #endif
71 
72 #if !UCONFIG_NO_CONVERSION
73 
75 
77 #define UCNV_MAX_CONVERTER_NAME_LENGTH 60
78 
79 #define UCNV_MAX_FULL_FILE_NAME_LENGTH (600+UCNV_MAX_CONVERTER_NAME_LENGTH)
80 
82 #define UCNV_SI 0x0F
83 
84 #define UCNV_SO 0x0E
85 
91 typedef enum {
95  UCNV_SBCS = 0,
97  UCNV_DBCS = 1,
99  UCNV_MBCS = 2,
116 
165 
166  /* Number of converter types for which we have conversion routines. */
167  UCNV_NUMBER_OF_SUPPORTED_CONVERTER_TYPES
169 
179 typedef enum {
180  UCNV_UNKNOWN = -1,
181  UCNV_IBM = 0
183 
199 typedef void (U_EXPORT2 *UConverterToUCallback) (
200  const void* context,
202  const char *codeUnits,
203  int32_t length,
205  UErrorCode *pErrorCode);
206 
222 typedef void (U_EXPORT2 *UConverterFromUCallback) (
223  const void* context,
225  const UChar* codeUnits,
226  int32_t length,
227  UChar32 codePoint,
229  UErrorCode *pErrorCode);
230 
232 
238 #define UCNV_OPTION_SEP_CHAR ','
239 
245 #define UCNV_OPTION_SEP_STRING ","
246 
252 #define UCNV_VALUE_SEP_CHAR '='
253 
259 #define UCNV_VALUE_SEP_STRING "="
260 
269 #define UCNV_LOCALE_OPTION_STRING ",locale="
270 
282 #define UCNV_VERSION_OPTION_STRING ",version="
283 
294 #define UCNV_SWAP_LFNL_OPTION_STRING ",swaplfnl"
295 
311 U_STABLE int U_EXPORT2
312 ucnv_compareNames(const char *name1, const char *name2);
313 
314 
365 U_STABLE UConverter* U_EXPORT2
366 ucnv_open(const char *converterName, UErrorCode *err);
367 
368 
395 U_STABLE UConverter* U_EXPORT2
396 ucnv_openU(const UChar *name,
397  UErrorCode *err);
398 
463 U_STABLE UConverter* U_EXPORT2
464 ucnv_openCCSID(int32_t codepage,
465  UConverterPlatform platform,
466  UErrorCode * err);
467 
498 U_STABLE UConverter* U_EXPORT2
499 ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err);
500 
540 U_STABLE UConverter * U_EXPORT2
541 ucnv_safeClone(const UConverter *cnv,
542  void *stackBuffer,
543  int32_t *pBufferSize,
544  UErrorCode *status);
545 
546 #ifndef U_HIDE_DEPRECATED_API
547 
554 #define U_CNV_SAFECLONE_BUFFERSIZE 1024
555 
556 #endif /* U_HIDE_DEPRECATED_API */
557 
569 U_STABLE void U_EXPORT2
570 ucnv_close(UConverter * converter);
571 
572 #if U_SHOW_CPLUSPLUS_API
573 
574 U_NAMESPACE_BEGIN
575 
586 
587 U_NAMESPACE_END
588 
589 #endif
590 
608 U_STABLE void U_EXPORT2
609 ucnv_getSubstChars(const UConverter *converter,
610  char *subChars,
611  int8_t *len,
612  UErrorCode *err);
613 
633 U_STABLE void U_EXPORT2
634 ucnv_setSubstChars(UConverter *converter,
635  const char *subChars,
636  int8_t len,
637  UErrorCode *err);
638 
666 U_STABLE void U_EXPORT2
668  const UChar *s,
669  int32_t length,
670  UErrorCode *err);
671 
685 U_STABLE void U_EXPORT2
686 ucnv_getInvalidChars(const UConverter *converter,
687  char *errBytes,
688  int8_t *len,
689  UErrorCode *err);
690 
704 U_STABLE void U_EXPORT2
705 ucnv_getInvalidUChars(const UConverter *converter,
706  UChar *errUChars,
707  int8_t *len,
708  UErrorCode *err);
709 
717 U_STABLE void U_EXPORT2
718 ucnv_reset(UConverter *converter);
719 
728 U_STABLE void U_EXPORT2
729 ucnv_resetToUnicode(UConverter *converter);
730 
739 U_STABLE void U_EXPORT2
741 
792 U_STABLE int8_t U_EXPORT2
793 ucnv_getMaxCharSize(const UConverter *converter);
794 
814 #define UCNV_GET_MAX_BYTES_FOR_STRING(length, maxCharSize) \
815  (((int32_t)(length)+10)*(int32_t)(maxCharSize))
816 
825 U_STABLE int8_t U_EXPORT2
826 ucnv_getMinCharSize(const UConverter *converter);
827 
842 U_STABLE int32_t U_EXPORT2
843 ucnv_getDisplayName(const UConverter *converter,
844  const char *displayLocale,
845  UChar *displayName,
846  int32_t displayNameCapacity,
847  UErrorCode *err);
848 
859 U_STABLE const char * U_EXPORT2
860 ucnv_getName(const UConverter *converter, UErrorCode *err);
861 
885 U_STABLE int32_t U_EXPORT2
886 ucnv_getCCSID(const UConverter *converter,
887  UErrorCode *err);
888 
900 ucnv_getPlatform(const UConverter *converter,
901  UErrorCode *err);
902 
911 U_STABLE UConverterType U_EXPORT2
912 ucnv_getType(const UConverter * converter);
913 
929 U_STABLE void U_EXPORT2
930 ucnv_getStarters(const UConverter* converter,
931  UBool starters[256],
932  UErrorCode* err);
933 
934 
940 typedef enum UConverterUnicodeSet {
945 #ifndef U_HIDE_DEPRECATED_API
946 
951 #endif // U_HIDE_DEPRECATED_API
953 
954 
1000 U_STABLE void U_EXPORT2
1001 ucnv_getUnicodeSet(const UConverter *cnv,
1002  USet *setFillIn,
1003  UConverterUnicodeSet whichSet,
1004  UErrorCode *pErrorCode);
1005 
1017 U_STABLE void U_EXPORT2
1018 ucnv_getToUCallBack (const UConverter * converter,
1019  UConverterToUCallback *action,
1020  const void **context);
1021 
1033 U_STABLE void U_EXPORT2
1034 ucnv_getFromUCallBack (const UConverter * converter,
1035  UConverterFromUCallback *action,
1036  const void **context);
1037 
1053 U_STABLE void U_EXPORT2
1054 ucnv_setToUCallBack (UConverter * converter,
1055  UConverterToUCallback newAction,
1056  const void* newContext,
1057  UConverterToUCallback *oldAction,
1058  const void** oldContext,
1059  UErrorCode * err);
1060 
1076 U_STABLE void U_EXPORT2
1077 ucnv_setFromUCallBack (UConverter * converter,
1078  UConverterFromUCallback newAction,
1079  const void *newContext,
1080  UConverterFromUCallback *oldAction,
1081  const void **oldContext,
1082  UErrorCode * err);
1083 
1142 U_STABLE void U_EXPORT2
1143 ucnv_fromUnicode (UConverter * converter,
1144  char **target,
1145  const char *targetLimit,
1146  const UChar ** source,
1147  const UChar * sourceLimit,
1148  int32_t* offsets,
1149  UBool flush,
1150  UErrorCode * err);
1151 
1211 U_STABLE void U_EXPORT2
1212 ucnv_toUnicode(UConverter *converter,
1213  UChar **target,
1214  const UChar *targetLimit,
1215  const char **source,
1216  const char *sourceLimit,
1217  int32_t *offsets,
1218  UBool flush,
1219  UErrorCode *err);
1220 
1248 U_STABLE int32_t U_EXPORT2
1250  char *dest, int32_t destCapacity,
1251  const UChar *src, int32_t srcLength,
1252  UErrorCode *pErrorCode);
1253 
1280 U_STABLE int32_t U_EXPORT2
1282  UChar *dest, int32_t destCapacity,
1283  const char *src, int32_t srcLength,
1284  UErrorCode *pErrorCode);
1285 
1356 U_STABLE UChar32 U_EXPORT2
1357 ucnv_getNextUChar(UConverter * converter,
1358  const char **source,
1359  const char * sourceLimit,
1360  UErrorCode * err);
1361 
1500 U_STABLE void U_EXPORT2
1501 ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
1502  char **target, const char *targetLimit,
1503  const char **source, const char *sourceLimit,
1504  UChar *pivotStart, UChar **pivotSource,
1505  UChar **pivotTarget, const UChar *pivotLimit,
1506  UBool reset, UBool flush,
1507  UErrorCode *pErrorCode);
1508 
1564 U_STABLE int32_t U_EXPORT2
1565 ucnv_convert(const char *toConverterName,
1566  const char *fromConverterName,
1567  char *target,
1568  int32_t targetCapacity,
1569  const char *source,
1570  int32_t sourceLength,
1571  UErrorCode *pErrorCode);
1572 
1618 U_STABLE int32_t U_EXPORT2
1619 ucnv_toAlgorithmic(UConverterType algorithmicType,
1620  UConverter *cnv,
1621  char *target, int32_t targetCapacity,
1622  const char *source, int32_t sourceLength,
1623  UErrorCode *pErrorCode);
1624 
1670 U_STABLE int32_t U_EXPORT2
1672  UConverterType algorithmicType,
1673  char *target, int32_t targetCapacity,
1674  const char *source, int32_t sourceLength,
1675  UErrorCode *pErrorCode);
1676 
1684 U_STABLE int32_t U_EXPORT2
1685 ucnv_flushCache(void);
1686 
1694 U_STABLE int32_t U_EXPORT2
1695 ucnv_countAvailable(void);
1696 
1707 U_STABLE const char* U_EXPORT2
1708 ucnv_getAvailableName(int32_t n);
1709 
1722 U_STABLE UEnumeration * U_EXPORT2
1723 ucnv_openAllNames(UErrorCode *pErrorCode);
1724 
1735 U_STABLE uint16_t U_EXPORT2
1736 ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
1737 
1750 U_STABLE const char * U_EXPORT2
1751 ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
1752 
1766 U_STABLE void U_EXPORT2
1767 ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode);
1768 
1792 U_STABLE UEnumeration * U_EXPORT2
1793 ucnv_openStandardNames(const char *convName,
1794  const char *standard,
1795  UErrorCode *pErrorCode);
1796 
1802 U_STABLE uint16_t U_EXPORT2
1803 ucnv_countStandards(void);
1804 
1812 U_STABLE const char * U_EXPORT2
1813 ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode);
1814 
1834 U_STABLE const char * U_EXPORT2
1835 ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode);
1836 
1856 U_STABLE const char * U_EXPORT2
1857 ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErrorCode);
1858 
1873 U_STABLE const char * U_EXPORT2
1874 ucnv_getDefaultName(void);
1875 
1876 #ifndef U_HIDE_SYSTEM_API
1877 
1893 U_STABLE void U_EXPORT2
1894 ucnv_setDefaultName(const char *name);
1895 #endif /* U_HIDE_SYSTEM_API */
1896 
1914 U_STABLE void U_EXPORT2
1915 ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen);
1916 
1925 U_STABLE UBool U_EXPORT2
1926 ucnv_isAmbiguous(const UConverter *cnv);
1927 
1943 U_STABLE void U_EXPORT2
1944 ucnv_setFallback(UConverter *cnv, UBool usesFallback);
1945 
1955 U_STABLE UBool U_EXPORT2
1956 ucnv_usesFallback(const UConverter *cnv);
1957 
1987 U_STABLE const char* U_EXPORT2
1988 ucnv_detectUnicodeSignature(const char* source,
1989  int32_t sourceLength,
1990  int32_t *signatureLength,
1991  UErrorCode *pErrorCode);
1992 
2004 U_STABLE int32_t U_EXPORT2
2005 ucnv_fromUCountPending(const UConverter* cnv, UErrorCode* status);
2006 
2018 U_STABLE int32_t U_EXPORT2
2019 ucnv_toUCountPending(const UConverter* cnv, UErrorCode* status);
2020 
2036 U_STABLE UBool U_EXPORT2
2037 ucnv_isFixedWidth(UConverter *cnv, UErrorCode *status);
2038 
2039 #endif
2040 
2041 #endif
2042 /*_UCNV*/
UCNV_LMBCS_1
@ UCNV_LMBCS_1
Definition: ucnv.h:118
ucnv_safeClone
UConverter * ucnv_safeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
Thread safe converter cloning operation.
ucnv_getCanonicalName
const char * ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErrorCode)
This function will return the internal canonical converter name of the tagged alias.
UConverterToUnicodeArgs
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:210
UCNV_SET_COUNT
@ UCNV_SET_COUNT
Number of UConverterUnicodeSet selectors.
Definition: ucnv.h:950
ucnv_getStandardName
const char * ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode)
Returns a standard name for a given converter name.
ucnv_getName
const char * ucnv_getName(const UConverter *converter, UErrorCode *err)
Gets the internal, canonical name of the converter (zero-terminated).
ucnv_getAlias
const char * ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode)
Gives the name of the alias at given index of alias list.
ucnv_getAvailableName
const char * ucnv_getAvailableName(int32_t n)
Gets the canonical converter name of the specified converter from a list of all available converters ...
UConverterCallbackReason
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:157
UCNV_UTF7
@ UCNV_UTF7
Definition: ucnv.h:152
ucnv_setToUCallBack
void ucnv_setToUCallBack(UConverter *converter, UConverterToUCallback newAction, const void *newContext, UConverterToUCallback *oldAction, const void **oldContext, UErrorCode *err)
Changes the callback function used by the converter when an illegal or invalid sequence is found.
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:261
ucnv_getInvalidChars
void ucnv_getInvalidChars(const UConverter *converter, char *errBytes, int8_t *len, UErrorCode *err)
Fills in the output parameter, errBytes, with the error characters from the last failing conversion.
UCNV_ISCII
@ UCNV_ISCII
Definition: ucnv.h:148
ucnv_err.h
C UConverter predefined error callbacks.
ucnv_getAliases
void ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode)
Fill-up the list of alias names for the given alias.
ucnv_openU
UConverter * ucnv_openU(const UChar *name, UErrorCode *err)
Creates a Unicode converter with the names specified as unicode string.
ucnv_getStarters
void ucnv_getStarters(const UConverter *converter, UBool starters[256], UErrorCode *err)
Gets the "starter" (lead) bytes for converters of type MBCS.
ucnv_openAllNames
UEnumeration * ucnv_openAllNames(UErrorCode *pErrorCode)
Returns a UEnumeration to enumerate all of the canonical converter names, as per the alias file,...
UCNV_LMBCS_18
@ UCNV_LMBCS_18
Definition: ucnv.h:138
ucnv_getSubstChars
void ucnv_getSubstChars(const UConverter *converter, char *subChars, int8_t *len, UErrorCode *err)
Fills in the output parameter, subChars, with the substitution characters as multiple bytes.
UCNV_UTF16_BigEndian
@ UCNV_UTF16_BigEndian
Definition: ucnv.h:105
UCNV_MBCS
@ UCNV_MBCS
Definition: ucnv.h:99
ucnv_fromUnicode
void ucnv_fromUnicode(UConverter *converter, char **target, const char *targetLimit, const UChar **source, const UChar *sourceLimit, int32_t *offsets, UBool flush, UErrorCode *err)
Converts an array of unicode characters to an array of codepage characters.
UCNV_COMPOUND_TEXT
@ UCNV_COMPOUND_TEXT
Definition: ucnv.h:164
ucnv_fromUCountPending
int32_t ucnv_fromUCountPending(const UConverter *cnv, UErrorCode *status)
Returns the number of UChars held in the converter's internal state because more input is needed for ...
UCNV_EBCDIC_STATEFUL
@ UCNV_EBCDIC_STATEFUL
Definition: ucnv.h:113
ucnv_getType
UConverterType ucnv_getType(const UConverter *converter)
Gets the type of the converter e.g.
ucnv_getMinCharSize
int8_t ucnv_getMinCharSize(const UConverter *converter)
Returns the minimum byte length (per codepoint) for characters in this codepage.
ucnv_countAliases
uint16_t ucnv_countAliases(const char *alias, UErrorCode *pErrorCode)
Gives the number of aliases for a given converter or alias name.
ucnv_compareNames
int ucnv_compareNames(const char *name1, const char *name2)
Do a fuzzy compare of two converter/alias names.
ucnv_convert
int32_t ucnv_convert(const char *toConverterName, const char *fromConverterName, char *target, int32_t targetCapacity, const char *source, int32_t sourceLength, UErrorCode *pErrorCode)
Convert from one external charset to another.
ucnv_getStandard
const char * ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode)
Gives the name of the standard at given index of standard list.
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:425
ucnv_getInvalidUChars
void ucnv_getInvalidUChars(const UConverter *converter, UChar *errUChars, int8_t *len, UErrorCode *err)
Fills in the output parameter, errChars, with the error characters from the last failing conversion.
ucnv_toUnicode
void ucnv_toUnicode(UConverter *converter, UChar **target, const UChar *targetLimit, const char **source, const char *sourceLimit, int32_t *offsets, UBool flush, UErrorCode *err)
Converts a buffer of codepage bytes into an array of unicode UChars characters.
ucnv_open
UConverter * ucnv_open(const char *converterName, UErrorCode *err)
Creates a UConverter object with the name of a coded character set specified as a C string.
ucnv_setSubstString
void ucnv_setSubstString(UConverter *cnv, const UChar *s, int32_t length, UErrorCode *err)
Set a substitution string for converting from Unicode to a charset.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
UCNV_CESU8
@ UCNV_CESU8
Definition: ucnv.h:160
ucnv_openCCSID
UConverter * ucnv_openCCSID(int32_t codepage, UConverterPlatform platform, UErrorCode *err)
Creates a UConverter object from a CCSID number and platform pair.
ucnv_fromAlgorithmic
int32_t ucnv_fromAlgorithmic(UConverter *cnv, UConverterType algorithmicType, char *target, int32_t targetCapacity, const char *source, int32_t sourceLength, UErrorCode *pErrorCode)
Convert from one external charset to another.
ucnv_getMaxCharSize
int8_t ucnv_getMaxCharSize(const UConverter *converter)
Returns the maximum number of bytes that are output per UChar in conversion from Unicode using this c...
ucnv_openStandardNames
UEnumeration * ucnv_openStandardNames(const char *convName, const char *standard, UErrorCode *pErrorCode)
Return a new UEnumeration object for enumerating all the alias names for a given converter that are r...
UConverterFromUnicodeArgs
The structure for the fromUnicode callback function parameter.
Definition: ucnv_err.h:194
UCNV_UTF8
@ UCNV_UTF8
Definition: ucnv.h:103
ucnv_convertEx
void ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv, char **target, const char *targetLimit, const char **source, const char *sourceLimit, UChar *pivotStart, UChar **pivotSource, UChar **pivotTarget, const UChar *pivotLimit, UBool reset, UBool flush, UErrorCode *pErrorCode)
Convert from one external charset to another using two existing UConverters.
ucnv_getNextUChar
UChar32 ucnv_getNextUChar(UConverter *converter, const char **source, const char *sourceLimit, UErrorCode *err)
Convert a codepage buffer into Unicode one character at a time.
UCNV_UTF16_LittleEndian
@ UCNV_UTF16_LittleEndian
Definition: ucnv.h:107
UCNV_UTF32_BigEndian
@ UCNV_UTF32_BigEndian
Definition: ucnv.h:109
ucnv_setSubstChars
void ucnv_setSubstChars(UConverter *converter, const char *subChars, int8_t len, UErrorCode *err)
Sets the substitution chars when converting from unicode to a codepage.
ucnv_countStandards
uint16_t ucnv_countStandards(void)
Gives the number of standards associated to converter names.
UCNV_SCSU
@ UCNV_SCSU
Definition: ucnv.h:146
U_CDECL_END
#define U_CDECL_END
Definition: umachine.h:85
ucnv_openPackage
UConverter * ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err)
UCNV_LMBCS_16
@ UCNV_LMBCS_16
Definition: ucnv.h:134
U_CDECL_BEGIN
#define U_CDECL_BEGIN
Definition: umachine.h:84
UConverterPlatform
UConverterPlatform
Enum for specifying which platform a converter ID refers to.
Definition: ucnv.h:179
ucnv_close
void ucnv_close(UConverter *converter)
Deletes the unicode converter and releases resources associated with just this instance.
ucnv_isFixedWidth
UBool ucnv_isFixedWidth(UConverter *cnv, UErrorCode *status)
Returns whether or not the charset of the converter has a fixed number of bytes per charset character...
UConverterType
UConverterType
Enum for specifying basic types of converters.
Definition: ucnv.h:91
UCNV_US_ASCII
@ UCNV_US_ASCII
Definition: ucnv.h:150
UConverterToUCallback
void(* UConverterToUCallback)(const void *context, UConverterToUnicodeArgs *args, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *pErrorCode)
Function pointer for error callback in the codepage to unicode direction.
Definition: ucnv.h:199
ucnv_getToUCallBack
void ucnv_getToUCallBack(const UConverter *converter, UConverterToUCallback *action, const void **context)
Gets the current calback function used by the converter when an illegal or invalid codepage sequence ...
ucnv_flushCache
int32_t ucnv_flushCache(void)
Frees up memory occupied by unused, cached converter shared data.
ucnv_fixFileSeparator
void ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen)
Fixes the backslash character mismapping.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
Definition: localpointer.h:562
ucnv_getCCSID
int32_t ucnv_getCCSID(const UConverter *converter, UErrorCode *err)
Gets a codepage number associated with the converter.
UCNV_LMBCS_3
@ UCNV_LMBCS_3
Definition: ucnv.h:122
ucnv_getDefaultName
const char * ucnv_getDefaultName(void)
Returns the current default converter name.
ucnv_toUCountPending
int32_t ucnv_toUCountPending(const UConverter *cnv, UErrorCode *status)
Returns the number of chars held in the converter's internal state because more input is needed for c...
ucnv_setDefaultName
void ucnv_setDefaultName(const char *name)
This function is not thread safe.
ucnv_countAvailable
int32_t ucnv_countAvailable(void)
Returns the number of available converters, as per the alias file.
UCNV_IMAP_MAILBOX
@ UCNV_IMAP_MAILBOX
Definition: ucnv.h:162
ucnv_toAlgorithmic
int32_t ucnv_toAlgorithmic(UConverterType algorithmicType, UConverter *cnv, char *target, int32_t targetCapacity, const char *source, int32_t sourceLength, UErrorCode *pErrorCode)
Convert from one external charset to another.
ucnv_toUChars
int32_t ucnv_toUChars(UConverter *cnv, UChar *dest, int32_t destCapacity, const char *src, int32_t srcLength, UErrorCode *pErrorCode)
Convert the codepage string into a Unicode string using an existing UConverter.
UCNV_LMBCS_19
@ UCNV_LMBCS_19
Definition: ucnv.h:140
UCNV_DBCS
@ UCNV_DBCS
Definition: ucnv.h:97
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UConverterFromUCallback
void(* UConverterFromUCallback)(const void *context, UConverterFromUnicodeArgs *args, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *pErrorCode)
Function pointer for error callback in the unicode to codepage direction.
Definition: ucnv.h:222
UConverterUnicodeSet
UConverterUnicodeSet
Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet().
Definition: ucnv.h:940
UCNV_UTF16
@ UCNV_UTF16
Definition: ucnv.h:156
ucnv_resetFromUnicode
void ucnv_resetFromUnicode(UConverter *converter)
Resets the from-Unicode part of a converter state to the default state.
ucnv_usesFallback
UBool ucnv_usesFallback(const UConverter *cnv)
Determines if the converter uses fallback mappings or not.
UCNV_HZ
@ UCNV_HZ
Definition: ucnv.h:144
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
ucnv_setFromUCallBack
void ucnv_setFromUCallBack(UConverter *converter, UConverterFromUCallback newAction, const void *newContext, UConverterFromUCallback *oldAction, const void **oldContext, UErrorCode *err)
Changes the current callback function used by the converter when an illegal or invalid sequence is fo...
UConverter
struct UConverter UConverter
Definition: ucnv_err.h:96
ucnv_isAmbiguous
UBool ucnv_isAmbiguous(const UConverter *cnv)
Determines if the converter contains ambiguous mappings of the same character or not.
UCNV_UNSUPPORTED_CONVERTER
@ UCNV_UNSUPPORTED_CONVERTER
Definition: ucnv.h:93
UChar
uint16_t UChar
Definition: umachine.h:378
UCNV_LMBCS_LAST
@ UCNV_LMBCS_LAST
Definition: ucnv.h:142
ucnv_getPlatform
UConverterPlatform ucnv_getPlatform(const UConverter *converter, UErrorCode *err)
Gets a codepage platform associated with the converter.
UCNV_ISO_2022
@ UCNV_ISO_2022
Definition: ucnv.h:115
ucnv_setFallback
void ucnv_setFallback(UConverter *cnv, UBool usesFallback)
Sets the converter to use fallback mappings or not.
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:43
ucnv_detectUnicodeSignature
const char * ucnv_detectUnicodeSignature(const char *source, int32_t sourceLength, int32_t *signatureLength, UErrorCode *pErrorCode)
Detects Unicode signature byte sequences at the start of the byte stream and returns the charset name...
UCNV_LMBCS_11
@ UCNV_LMBCS_11
Definition: ucnv.h:132
ucnv_reset
void ucnv_reset(UConverter *converter)
Resets the state of a converter to the default state.
UCNV_LMBCS_2
@ UCNV_LMBCS_2
Definition: ucnv.h:120
ucnv_resetToUnicode
void ucnv_resetToUnicode(UConverter *converter)
Resets the to-Unicode part of a converter state to the default state.
UCNV_LMBCS_6
@ UCNV_LMBCS_6
Definition: ucnv.h:128
UCNV_ROUNDTRIP_SET
@ UCNV_ROUNDTRIP_SET
Select the set of roundtrippable Unicode code points.
Definition: ucnv.h:942
UCNV_ROUNDTRIP_AND_FALLBACK_SET
@ UCNV_ROUNDTRIP_AND_FALLBACK_SET
Select the set of Unicode code points with roundtrip or fallback mappings.
Definition: ucnv.h:944
UCNV_UTF32
@ UCNV_UTF32
Definition: ucnv.h:158
USet
struct USet USet
USet is the C API type corresponding to C++ class UnicodeSet.
Definition: uset.h:47
UCNV_LMBCS_4
@ UCNV_LMBCS_4
Definition: ucnv.h:124
UCNV_LMBCS_8
@ UCNV_LMBCS_8
Definition: ucnv.h:130
UCNV_LATIN_1
@ UCNV_LATIN_1
Definition: ucnv.h:101
UCNV_BOCU1
@ UCNV_BOCU1
Definition: ucnv.h:154
ucnv_fromUChars
int32_t ucnv_fromUChars(UConverter *cnv, char *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, UErrorCode *pErrorCode)
Convert the Unicode string into a codepage string using an existing UConverter.
LocalUConverterPointer
UCNV_LMBCS_17
@ UCNV_LMBCS_17
Definition: ucnv.h:136
uenum.h
C API: String Enumeration.
UCNV_SBCS
@ UCNV_SBCS
Definition: ucnv.h:95
ucnv_getFromUCallBack
void ucnv_getFromUCallBack(const UConverter *converter, UConverterFromUCallback *action, const void **context)
Gets the current callback function used by the converter when illegal or invalid Unicode sequence is ...
UCNV_UTF32_LittleEndian
@ UCNV_UTF32_LittleEndian
Definition: ucnv.h:111
UCNV_LMBCS_5
@ UCNV_LMBCS_5
Definition: ucnv.h:126
ucnv_getUnicodeSet
void ucnv_getUnicodeSet(const UConverter *cnv, USet *setFillIn, UConverterUnicodeSet whichSet, UErrorCode *pErrorCode)
Returns the set of Unicode code points that can be converted by an ICU converter.
ucnv_getDisplayName
int32_t ucnv_getDisplayName(const UConverter *converter, const char *displayLocale, UChar *displayName, int32_t displayNameCapacity, UErrorCode *err)
Returns the display name of the converter passed in based on the Locale passed in.