ICU 55.1  55.1
ucnv.h
Go to the documentation of this file.
1 /*
2 **********************************************************************
3 * Copyright (C) 1999-2014, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6  * ucnv.h:
7  * External APIs for the ICU's codeset conversion library
8  * Bertrand A. Damiba
9  *
10  * Modification History:
11  *
12  * Date Name Description
13  * 04/04/99 helena Fixed internal header inclusion.
14  * 05/11/00 helena Added setFallback and usesFallback APIs.
15  * 06/29/2000 helena Major rewrite of the callback APIs.
16  * 12/07/2000 srl Update of documentation
17  */
18 
47 #ifndef UCNV_H
48 #define UCNV_H
49 
50 #include "unicode/ucnv_err.h"
51 #include "unicode/uenum.h"
52 #include "unicode/localpointer.h"
53 
54 #ifndef __USET_H__
55 
65 struct USet;
67 typedef struct USet USet;
68 
69 #endif
70 
71 #if !UCONFIG_NO_CONVERSION
72 
74 
76 #define UCNV_MAX_CONVERTER_NAME_LENGTH 60
77 
78 #define UCNV_MAX_FULL_FILE_NAME_LENGTH (600+UCNV_MAX_CONVERTER_NAME_LENGTH)
79 
81 #define UCNV_SI 0x0F
82 
83 #define UCNV_SO 0x0E
84 
90 typedef enum {
94  UCNV_SBCS = 0,
96  UCNV_DBCS = 1,
98  UCNV_MBCS = 2,
115 
164 
165  /* Number of converter types for which we have conversion routines. */
166  UCNV_NUMBER_OF_SUPPORTED_CONVERTER_TYPES
168 
178 typedef enum {
179  UCNV_UNKNOWN = -1,
180  UCNV_IBM = 0
182 
198 typedef void (U_EXPORT2 *UConverterToUCallback) (
199  const void* context,
201  const char *codeUnits,
202  int32_t length,
204  UErrorCode *pErrorCode);
205 
221 typedef void (U_EXPORT2 *UConverterFromUCallback) (
222  const void* context,
224  const UChar* codeUnits,
225  int32_t length,
226  UChar32 codePoint,
228  UErrorCode *pErrorCode);
229 
231 
237 #define UCNV_OPTION_SEP_CHAR ','
238 
244 #define UCNV_OPTION_SEP_STRING ","
245 
251 #define UCNV_VALUE_SEP_CHAR '='
252 
258 #define UCNV_VALUE_SEP_STRING "="
259 
268 #define UCNV_LOCALE_OPTION_STRING ",locale="
269 
281 #define UCNV_VERSION_OPTION_STRING ",version="
282 
293 #define UCNV_SWAP_LFNL_OPTION_STRING ",swaplfnl"
294 
310 U_STABLE int U_EXPORT2
311 ucnv_compareNames(const char *name1, const char *name2);
312 
313 
364 U_STABLE UConverter* U_EXPORT2
365 ucnv_open(const char *converterName, UErrorCode *err);
366 
367 
394 U_STABLE UConverter* U_EXPORT2
395 ucnv_openU(const UChar *name,
396  UErrorCode *err);
397 
462 U_STABLE UConverter* U_EXPORT2
463 ucnv_openCCSID(int32_t codepage,
464  UConverterPlatform platform,
465  UErrorCode * err);
466 
497 U_STABLE UConverter* U_EXPORT2
498 ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err);
499 
539 U_STABLE UConverter * U_EXPORT2
540 ucnv_safeClone(const UConverter *cnv,
541  void *stackBuffer,
542  int32_t *pBufferSize,
543  UErrorCode *status);
544 
545 #ifndef U_HIDE_DEPRECATED_API
546 
553 #define U_CNV_SAFECLONE_BUFFERSIZE 1024
554 
555 #endif /* U_HIDE_DEPRECATED_API */
556 
568 U_STABLE void U_EXPORT2
569 ucnv_close(UConverter * converter);
570 
571 #if U_SHOW_CPLUSPLUS_API
572 
574 
585 
587 
588 #endif
589 
607 U_STABLE void U_EXPORT2
608 ucnv_getSubstChars(const UConverter *converter,
609  char *subChars,
610  int8_t *len,
611  UErrorCode *err);
612 
632 U_STABLE void U_EXPORT2
633 ucnv_setSubstChars(UConverter *converter,
634  const char *subChars,
635  int8_t len,
636  UErrorCode *err);
637 
665 U_STABLE void U_EXPORT2
667  const UChar *s,
668  int32_t length,
669  UErrorCode *err);
670 
684 U_STABLE void U_EXPORT2
685 ucnv_getInvalidChars(const UConverter *converter,
686  char *errBytes,
687  int8_t *len,
688  UErrorCode *err);
689 
703 U_STABLE void U_EXPORT2
704 ucnv_getInvalidUChars(const UConverter *converter,
705  UChar *errUChars,
706  int8_t *len,
707  UErrorCode *err);
708 
716 U_STABLE void U_EXPORT2
717 ucnv_reset(UConverter *converter);
718 
727 U_STABLE void U_EXPORT2
728 ucnv_resetToUnicode(UConverter *converter);
729 
738 U_STABLE void U_EXPORT2
740 
791 U_STABLE int8_t U_EXPORT2
792 ucnv_getMaxCharSize(const UConverter *converter);
793 
813 #define UCNV_GET_MAX_BYTES_FOR_STRING(length, maxCharSize) \
814  (((int32_t)(length)+10)*(int32_t)(maxCharSize))
815 
824 U_STABLE int8_t U_EXPORT2
825 ucnv_getMinCharSize(const UConverter *converter);
826 
841 U_STABLE int32_t U_EXPORT2
842 ucnv_getDisplayName(const UConverter *converter,
843  const char *displayLocale,
844  UChar *displayName,
845  int32_t displayNameCapacity,
846  UErrorCode *err);
847 
858 U_STABLE const char * U_EXPORT2
859 ucnv_getName(const UConverter *converter, UErrorCode *err);
860 
884 U_STABLE int32_t U_EXPORT2
885 ucnv_getCCSID(const UConverter *converter,
886  UErrorCode *err);
887 
899 ucnv_getPlatform(const UConverter *converter,
900  UErrorCode *err);
901 
910 U_STABLE UConverterType U_EXPORT2
911 ucnv_getType(const UConverter * converter);
912 
928 U_STABLE void U_EXPORT2
929 ucnv_getStarters(const UConverter* converter,
930  UBool starters[256],
931  UErrorCode* err);
932 
933 
939 typedef enum UConverterUnicodeSet {
947 
948 
994 U_STABLE void U_EXPORT2
995 ucnv_getUnicodeSet(const UConverter *cnv,
996  USet *setFillIn,
997  UConverterUnicodeSet whichSet,
998  UErrorCode *pErrorCode);
999 
1011 U_STABLE void U_EXPORT2
1012 ucnv_getToUCallBack (const UConverter * converter,
1013  UConverterToUCallback *action,
1014  const void **context);
1015 
1027 U_STABLE void U_EXPORT2
1028 ucnv_getFromUCallBack (const UConverter * converter,
1029  UConverterFromUCallback *action,
1030  const void **context);
1031 
1047 U_STABLE void U_EXPORT2
1048 ucnv_setToUCallBack (UConverter * converter,
1049  UConverterToUCallback newAction,
1050  const void* newContext,
1051  UConverterToUCallback *oldAction,
1052  const void** oldContext,
1053  UErrorCode * err);
1054 
1070 U_STABLE void U_EXPORT2
1071 ucnv_setFromUCallBack (UConverter * converter,
1072  UConverterFromUCallback newAction,
1073  const void *newContext,
1074  UConverterFromUCallback *oldAction,
1075  const void **oldContext,
1076  UErrorCode * err);
1077 
1136 U_STABLE void U_EXPORT2
1137 ucnv_fromUnicode (UConverter * converter,
1138  char **target,
1139  const char *targetLimit,
1140  const UChar ** source,
1141  const UChar * sourceLimit,
1142  int32_t* offsets,
1143  UBool flush,
1144  UErrorCode * err);
1145 
1205 U_STABLE void U_EXPORT2
1206 ucnv_toUnicode(UConverter *converter,
1207  UChar **target,
1208  const UChar *targetLimit,
1209  const char **source,
1210  const char *sourceLimit,
1211  int32_t *offsets,
1212  UBool flush,
1213  UErrorCode *err);
1214 
1242 U_STABLE int32_t U_EXPORT2
1244  char *dest, int32_t destCapacity,
1245  const UChar *src, int32_t srcLength,
1246  UErrorCode *pErrorCode);
1247 
1274 U_STABLE int32_t U_EXPORT2
1276  UChar *dest, int32_t destCapacity,
1277  const char *src, int32_t srcLength,
1278  UErrorCode *pErrorCode);
1279 
1350 U_STABLE UChar32 U_EXPORT2
1351 ucnv_getNextUChar(UConverter * converter,
1352  const char **source,
1353  const char * sourceLimit,
1354  UErrorCode * err);
1355 
1494 U_STABLE void U_EXPORT2
1495 ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
1496  char **target, const char *targetLimit,
1497  const char **source, const char *sourceLimit,
1498  UChar *pivotStart, UChar **pivotSource,
1499  UChar **pivotTarget, const UChar *pivotLimit,
1500  UBool reset, UBool flush,
1501  UErrorCode *pErrorCode);
1502 
1558 U_STABLE int32_t U_EXPORT2
1559 ucnv_convert(const char *toConverterName,
1560  const char *fromConverterName,
1561  char *target,
1562  int32_t targetCapacity,
1563  const char *source,
1564  int32_t sourceLength,
1565  UErrorCode *pErrorCode);
1566 
1612 U_STABLE int32_t U_EXPORT2
1613 ucnv_toAlgorithmic(UConverterType algorithmicType,
1614  UConverter *cnv,
1615  char *target, int32_t targetCapacity,
1616  const char *source, int32_t sourceLength,
1617  UErrorCode *pErrorCode);
1618 
1664 U_STABLE int32_t U_EXPORT2
1666  UConverterType algorithmicType,
1667  char *target, int32_t targetCapacity,
1668  const char *source, int32_t sourceLength,
1669  UErrorCode *pErrorCode);
1670 
1678 U_STABLE int32_t U_EXPORT2
1679 ucnv_flushCache(void);
1680 
1688 U_STABLE int32_t U_EXPORT2
1689 ucnv_countAvailable(void);
1690 
1701 U_STABLE const char* U_EXPORT2
1702 ucnv_getAvailableName(int32_t n);
1703 
1716 U_STABLE UEnumeration * U_EXPORT2
1717 ucnv_openAllNames(UErrorCode *pErrorCode);
1718 
1729 U_STABLE uint16_t U_EXPORT2
1730 ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
1731 
1744 U_STABLE const char * U_EXPORT2
1745 ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
1746 
1760 U_STABLE void U_EXPORT2
1761 ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode);
1762 
1786 U_STABLE UEnumeration * U_EXPORT2
1787 ucnv_openStandardNames(const char *convName,
1788  const char *standard,
1789  UErrorCode *pErrorCode);
1790 
1796 U_STABLE uint16_t U_EXPORT2
1797 ucnv_countStandards(void);
1798 
1806 U_STABLE const char * U_EXPORT2
1807 ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode);
1808 
1828 U_STABLE const char * U_EXPORT2
1829 ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode);
1830 
1850 U_STABLE const char * U_EXPORT2
1851 ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErrorCode);
1852 
1867 U_STABLE const char * U_EXPORT2
1868 ucnv_getDefaultName(void);
1869 
1870 #ifndef U_HIDE_SYSTEM_API
1871 
1887 U_STABLE void U_EXPORT2
1888 ucnv_setDefaultName(const char *name);
1889 #endif /* U_HIDE_SYSTEM_API */
1890 
1908 U_STABLE void U_EXPORT2
1909 ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen);
1910 
1919 U_STABLE UBool U_EXPORT2
1920 ucnv_isAmbiguous(const UConverter *cnv);
1921 
1937 U_STABLE void U_EXPORT2
1938 ucnv_setFallback(UConverter *cnv, UBool usesFallback);
1939 
1949 U_STABLE UBool U_EXPORT2
1950 ucnv_usesFallback(const UConverter *cnv);
1951 
1981 U_STABLE const char* U_EXPORT2
1982 ucnv_detectUnicodeSignature(const char* source,
1983  int32_t sourceLength,
1984  int32_t *signatureLength,
1985  UErrorCode *pErrorCode);
1986 
1998 U_STABLE int32_t U_EXPORT2
1999 ucnv_fromUCountPending(const UConverter* cnv, UErrorCode* status);
2000 
2012 U_STABLE int32_t U_EXPORT2
2013 ucnv_toUCountPending(const UConverter* cnv, UErrorCode* status);
2014 
2030 U_STABLE UBool U_EXPORT2
2031 ucnv_isFixedWidth(UConverter *cnv, UErrorCode *status);
2032 
2033 #endif
2034 
2035 #endif
2036 /*_UCNV*/
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:208
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.
UBool ucnv_usesFallback(const UConverter *cnv)
Determines if the converter uses fallback mappings or not.
void ucnv_setSubstString(UConverter *cnv, const UChar *s, int32_t length, UErrorCode *err)
Set a substitution string for converting from Unicode to a charset.
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:155
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 ...
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...
int ucnv_compareNames(const char *name1, const char *name2)
Do a fuzzy compare of two converter/alias names.
const char * ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode)
Gives the name of the standard at given index of standard list.
uint16_t ucnv_countStandards(void)
Gives the number of standards associated to converter names.
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...
void ucnv_resetFromUnicode(UConverter *converter)
Resets the from-Unicode part of a converter state to the default state.
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...
UConverterType ucnv_getType(const UConverter *converter)
Gets the type of the converter e.g.
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.
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 ...
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:39
Number of UConverterUnicodeSet selectors.
Definition: ucnv.h:945
Definition: ucnv.h:94
int32_t ucnv_getCCSID(const UConverter *converter, UErrorCode *err)
Gets a codepage number associated with the converter.
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. ...
"Smart pointer" class, closes a UConverter via ucnv_close().
UConverter * ucnv_openCCSID(int32_t codepage, UConverterPlatform platform, UErrorCode *err)
Creates a UConverter object from a CCSID number and platform pair.
The structure for the fromUnicode callback function parameter.
Definition: ucnv_err.h:192
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:198
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.
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 ...
UConverter * ucnv_openU(const UChar *name, UErrorCode *err)
Creates a Unicode converter with the names specified as unicode string.
void ucnv_getStarters(const UConverter *converter, UBool starters[256], UErrorCode *err)
Gets the "starter" (lead) bytes for converters of type MBCS.
UConverter * ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err)
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition: umachine.h:82
const char * ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode)
Gives the name of the alias at given index of alias list.
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...
const char * ucnv_getAvailableName(int32_t n)
Gets the canonical converter name of the specified converter from a list of all available converters ...
int32_t ucnv_countAvailable(void)
Returns the number of available converters, as per the alias file.
Definition: ucnv.h:98
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...
UBool ucnv_isAmbiguous(const UConverter *cnv)
Determines if the converter contains ambiguous mappings of the same character or not.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
Definition: ucnv.h:96
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:338
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:221
UConverterUnicodeSet
Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet().
Definition: ucnv.h:939
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...
void ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode)
Fill-up the list of alias names for the given alias.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
uint16_t ucnv_countAliases(const char *alias, UErrorCode *pErrorCode)
Gives the number of aliases for a given converter or alias name.
void ucnv_setDefaultName(const char *name)
This function is not thread safe.
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:332
UConverterPlatform ucnv_getPlatform(const UConverter *converter, UErrorCode *err)
Gets a codepage platform associated with the converter.
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...
void ucnv_reset(UConverter *converter)
Resets the state of a converter to the default state.
Definition: ucnv.h:143
void ucnv_setFallback(UConverter *cnv, UBool usesFallback)
Sets the converter to use fallback mappings or not.
UConverter * ucnv_safeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
Thread safe converter cloning operation.
Select the set of roundtrippable Unicode code points.
Definition: ucnv.h:941
Select the set of Unicode code points with roundtrip or fallback mappings.
Definition: ucnv.h:943
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...
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:312
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition: umachine.h:83
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
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...
struct USet USet
Definition: ucnv.h:67
const char * ucnv_getName(const UConverter *converter, UErrorCode *err)
Gets the internal, canonical name of the converter (zero-terminated).
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.
void ucnv_resetToUnicode(UConverter *converter)
Resets the to-Unicode part of a converter state to the default state.
struct UConverter UConverter
Definition: ucnv_err.h:94
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
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.
void ucnv_setSubstChars(UConverter *converter, const char *subChars, int8_t len, UErrorCode *err)
Sets the substitution chars when converting from unicode to a codepage.
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.
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.
C API: String Enumeration.
void ucnv_close(UConverter *converter)
Deletes the unicode converter and releases resources associated with just this instance.
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.
UConverterType
Enum for specifying basic types of converters.
Definition: ucnv.h:90
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...
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.
void ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen)
Fixes the backslash character mismapping.
C UConverter predefined error callbacks.
UChar32 ucnv_getNextUChar(UConverter *converter, const char **source, const char *sourceLimit, UErrorCode *err)
Convert a codepage buffer into Unicode one character at a time.
int32_t ucnv_flushCache(void)
Frees up memory occupied by unused, cached converter shared data.
const char * ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode)
Returns a standard name for a given converter name.
int8_t ucnv_getMinCharSize(const UConverter *converter)
Returns the minimum byte length (per codepoint) for characters in this codepage.
UConverterPlatform
Enum for specifying which platform a converter ID refers to.
Definition: ucnv.h:178
const char * ucnv_getDefaultName(void)
Returns the current default converter name.
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...
UEnumeration * ucnv_openAllNames(UErrorCode *pErrorCode)
Returns a UEnumeration to enumerate all of the canonical converter names, as per the alias file...
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.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234