ICU 70.1  70.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 
48 #ifndef UCNV_H
49 #define UCNV_H
50 
51 #include "unicode/ucnv_err.h"
52 #include "unicode/uenum.h"
53 
54 #if U_SHOW_CPLUSPLUS_API
55 #include "unicode/localpointer.h"
56 #endif // U_SHOW_CPLUSPLUS_API
57 
58 #if !defined(USET_DEFINED) && !defined(U_IN_DOXYGEN)
59 
60 #define USET_DEFINED
61 
70 typedef struct USet USet;
71 
72 #endif
73 
74 #if !UCONFIG_NO_CONVERSION
75 
77 
79 #define UCNV_MAX_CONVERTER_NAME_LENGTH 60
81 #define UCNV_MAX_FULL_FILE_NAME_LENGTH (600+UCNV_MAX_CONVERTER_NAME_LENGTH)
82 
84 #define UCNV_SI 0x0F
86 #define UCNV_SO 0x0E
87 
93 typedef enum {
97  UCNV_SBCS = 0,
99  UCNV_DBCS = 1,
118 
167 
168  /* Number of converter types for which we have conversion routines. */
169  UCNV_NUMBER_OF_SUPPORTED_CONVERTER_TYPES
171 
181 typedef enum {
182  UCNV_UNKNOWN = -1,
183  UCNV_IBM = 0
185 
201 typedef void (U_EXPORT2 *UConverterToUCallback) (
202  const void* context,
204  const char *codeUnits,
205  int32_t length,
207  UErrorCode *pErrorCode);
208 
224 typedef void (U_EXPORT2 *UConverterFromUCallback) (
225  const void* context,
227  const UChar* codeUnits,
228  int32_t length,
229  UChar32 codePoint,
231  UErrorCode *pErrorCode);
232 
234 
240 #define UCNV_OPTION_SEP_CHAR ','
241 
247 #define UCNV_OPTION_SEP_STRING ","
248 
254 #define UCNV_VALUE_SEP_CHAR '='
255 
261 #define UCNV_VALUE_SEP_STRING "="
262 
271 #define UCNV_LOCALE_OPTION_STRING ",locale="
272 
284 #define UCNV_VERSION_OPTION_STRING ",version="
285 
296 #define UCNV_SWAP_LFNL_OPTION_STRING ",swaplfnl"
297 
313 U_CAPI int U_EXPORT2
314 ucnv_compareNames(const char *name1, const char *name2);
315 
316 
367 U_CAPI UConverter* U_EXPORT2
368 ucnv_open(const char *converterName, UErrorCode *err);
369 
370 
397 U_CAPI UConverter* U_EXPORT2
398 ucnv_openU(const UChar *name,
399  UErrorCode *err);
400 
465 U_CAPI UConverter* U_EXPORT2
466 ucnv_openCCSID(int32_t codepage,
467  UConverterPlatform platform,
468  UErrorCode * err);
469 
500 U_CAPI UConverter* U_EXPORT2
501 ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err);
502 
542 U_CAPI UConverter * U_EXPORT2
544  void *stackBuffer,
545  int32_t *pBufferSize,
546  UErrorCode *status);
547 
548 #ifndef U_HIDE_DEPRECATED_API
549 
556 #define U_CNV_SAFECLONE_BUFFERSIZE 1024
557 
558 #endif /* U_HIDE_DEPRECATED_API */
559 
571 U_CAPI void U_EXPORT2
572 ucnv_close(UConverter * converter);
573 
574 #if U_SHOW_CPLUSPLUS_API
575 
576 U_NAMESPACE_BEGIN
577 
588 
589 U_NAMESPACE_END
590 
591 #endif
592 
610 U_CAPI void U_EXPORT2
612  char *subChars,
613  int8_t *len,
614  UErrorCode *err);
615 
635 U_CAPI void U_EXPORT2
637  const char *subChars,
638  int8_t len,
639  UErrorCode *err);
640 
668 U_CAPI void U_EXPORT2
670  const UChar *s,
671  int32_t length,
672  UErrorCode *err);
673 
687 U_CAPI void U_EXPORT2
689  char *errBytes,
690  int8_t *len,
691  UErrorCode *err);
692 
706 U_CAPI void U_EXPORT2
708  UChar *errUChars,
709  int8_t *len,
710  UErrorCode *err);
711 
719 U_CAPI void U_EXPORT2
720 ucnv_reset(UConverter *converter);
721 
730 U_CAPI void U_EXPORT2
732 
741 U_CAPI void U_EXPORT2
743 
794 U_CAPI int8_t U_EXPORT2
795 ucnv_getMaxCharSize(const UConverter *converter);
796 
816 #define UCNV_GET_MAX_BYTES_FOR_STRING(length, maxCharSize) \
817  (((int32_t)(length)+10)*(int32_t)(maxCharSize))
818 
827 U_CAPI int8_t U_EXPORT2
828 ucnv_getMinCharSize(const UConverter *converter);
829 
844 U_CAPI int32_t U_EXPORT2
846  const char *displayLocale,
847  UChar *displayName,
848  int32_t displayNameCapacity,
849  UErrorCode *err);
850 
861 U_CAPI const char * U_EXPORT2
862 ucnv_getName(const UConverter *converter, UErrorCode *err);
863 
887 U_CAPI int32_t U_EXPORT2
888 ucnv_getCCSID(const UConverter *converter,
889  UErrorCode *err);
890 
901 U_CAPI UConverterPlatform U_EXPORT2
902 ucnv_getPlatform(const UConverter *converter,
903  UErrorCode *err);
904 
913 U_CAPI UConverterType U_EXPORT2
914 ucnv_getType(const UConverter * converter);
915 
931 U_CAPI void U_EXPORT2
932 ucnv_getStarters(const UConverter* converter,
933  UBool starters[256],
934  UErrorCode* err);
935 
936 
942 typedef enum UConverterUnicodeSet {
947 #ifndef U_HIDE_DEPRECATED_API
953 #endif // U_HIDE_DEPRECATED_API
955 
956 
1002 U_CAPI void U_EXPORT2
1004  USet *setFillIn,
1005  UConverterUnicodeSet whichSet,
1006  UErrorCode *pErrorCode);
1007 
1019 U_CAPI void U_EXPORT2
1020 ucnv_getToUCallBack (const UConverter * converter,
1021  UConverterToUCallback *action,
1022  const void **context);
1023 
1035 U_CAPI void U_EXPORT2
1037  UConverterFromUCallback *action,
1038  const void **context);
1039 
1055 U_CAPI void U_EXPORT2
1057  UConverterToUCallback newAction,
1058  const void* newContext,
1059  UConverterToUCallback *oldAction,
1060  const void** oldContext,
1061  UErrorCode * err);
1062 
1078 U_CAPI void U_EXPORT2
1080  UConverterFromUCallback newAction,
1081  const void *newContext,
1082  UConverterFromUCallback *oldAction,
1083  const void **oldContext,
1084  UErrorCode * err);
1085 
1144 U_CAPI void U_EXPORT2
1146  char **target,
1147  const char *targetLimit,
1148  const UChar ** source,
1149  const UChar * sourceLimit,
1150  int32_t* offsets,
1151  UBool flush,
1152  UErrorCode * err);
1153 
1213 U_CAPI void U_EXPORT2
1215  UChar **target,
1216  const UChar *targetLimit,
1217  const char **source,
1218  const char *sourceLimit,
1219  int32_t *offsets,
1220  UBool flush,
1221  UErrorCode *err);
1222 
1250 U_CAPI int32_t U_EXPORT2
1252  char *dest, int32_t destCapacity,
1253  const UChar *src, int32_t srcLength,
1254  UErrorCode *pErrorCode);
1255 
1282 U_CAPI int32_t U_EXPORT2
1284  UChar *dest, int32_t destCapacity,
1285  const char *src, int32_t srcLength,
1286  UErrorCode *pErrorCode);
1287 
1358 U_CAPI UChar32 U_EXPORT2
1360  const char **source,
1361  const char * sourceLimit,
1362  UErrorCode * err);
1363 
1502 U_CAPI void U_EXPORT2
1503 ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
1504  char **target, const char *targetLimit,
1505  const char **source, const char *sourceLimit,
1506  UChar *pivotStart, UChar **pivotSource,
1507  UChar **pivotTarget, const UChar *pivotLimit,
1508  UBool reset, UBool flush,
1509  UErrorCode *pErrorCode);
1510 
1566 U_CAPI int32_t U_EXPORT2
1567 ucnv_convert(const char *toConverterName,
1568  const char *fromConverterName,
1569  char *target,
1570  int32_t targetCapacity,
1571  const char *source,
1572  int32_t sourceLength,
1573  UErrorCode *pErrorCode);
1574 
1620 U_CAPI int32_t U_EXPORT2
1622  UConverter *cnv,
1623  char *target, int32_t targetCapacity,
1624  const char *source, int32_t sourceLength,
1625  UErrorCode *pErrorCode);
1626 
1672 U_CAPI int32_t U_EXPORT2
1674  UConverterType algorithmicType,
1675  char *target, int32_t targetCapacity,
1676  const char *source, int32_t sourceLength,
1677  UErrorCode *pErrorCode);
1678 
1686 U_CAPI int32_t U_EXPORT2
1688 
1696 U_CAPI int32_t U_EXPORT2
1698 
1709 U_CAPI const char* U_EXPORT2
1711 
1724 U_CAPI UEnumeration * U_EXPORT2
1726 
1737 U_CAPI uint16_t U_EXPORT2
1738 ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
1739 
1752 U_CAPI const char * U_EXPORT2
1753 ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
1754 
1768 U_CAPI void U_EXPORT2
1769 ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode);
1770 
1794 U_CAPI UEnumeration * U_EXPORT2
1795 ucnv_openStandardNames(const char *convName,
1796  const char *standard,
1797  UErrorCode *pErrorCode);
1798 
1804 U_CAPI uint16_t U_EXPORT2
1806 
1814 U_CAPI const char * U_EXPORT2
1815 ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode);
1816 
1836 U_CAPI const char * U_EXPORT2
1837 ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode);
1838 
1858 U_CAPI const char * U_EXPORT2
1859 ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErrorCode);
1860 
1875 U_CAPI const char * U_EXPORT2
1877 
1878 #ifndef U_HIDE_SYSTEM_API
1895 U_CAPI void U_EXPORT2
1896 ucnv_setDefaultName(const char *name);
1897 #endif /* U_HIDE_SYSTEM_API */
1898 
1916 U_CAPI void U_EXPORT2
1917 ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen);
1918 
1927 U_CAPI UBool U_EXPORT2
1929 
1945 U_CAPI void U_EXPORT2
1946 ucnv_setFallback(UConverter *cnv, UBool usesFallback);
1947 
1957 U_CAPI UBool U_EXPORT2
1959 
1989 U_CAPI const char* U_EXPORT2
1990 ucnv_detectUnicodeSignature(const char* source,
1991  int32_t sourceLength,
1992  int32_t *signatureLength,
1993  UErrorCode *pErrorCode);
1994 
2006 U_CAPI int32_t U_EXPORT2
2008 
2020 U_CAPI int32_t U_EXPORT2
2022 
2038 U_CAPI UBool U_EXPORT2
2040 
2041 #endif
2042 
2043 #endif
2044 /*_UCNV*/
"Smart pointer" class, closes a UConverter via ucnv_close().
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
The structure for the fromUnicode callback function parameter.
Definition: ucnv_err.h:194
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:210
U_CAPI UBool ucnv_usesFallback(const UConverter *cnv)
Determines if the converter uses fallback mappings or not.
U_CAPI 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...
U_CAPI UBool ucnv_isAmbiguous(const UConverter *cnv)
Determines if the converter contains ambiguous mappings of the same character or not.
U_CAPI void ucnv_setDefaultName(const char *name)
This function is not thread safe.
U_CAPI 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.
U_CAPI 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...
U_CAPI 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.
U_CAPI 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.
UConverterUnicodeSet
Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet().
Definition: ucnv.h:942
@ UCNV_SET_COUNT
Number of UConverterUnicodeSet selectors.
Definition: ucnv.h:952
@ UCNV_ROUNDTRIP_AND_FALLBACK_SET
Select the set of Unicode code points with roundtrip or fallback mappings.
Definition: ucnv.h:946
@ UCNV_ROUNDTRIP_SET
Select the set of roundtrippable Unicode code points.
Definition: ucnv.h:944
U_CAPI int32_t ucnv_flushCache(void)
Frees up memory occupied by unused, cached converter shared data.
U_CAPI void ucnv_resetFromUnicode(UConverter *converter)
Resets the from-Unicode part of a converter state to the default state.
U_CAPI 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.
U_CAPI 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.
U_CAPI UChar32 ucnv_getNextUChar(UConverter *converter, const char **source, const char *sourceLimit, UErrorCode *err)
Convert a codepage buffer into Unicode one character at a time.
U_CAPI UConverter * ucnv_safeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
Thread safe converter cloning operation.
U_CAPI void ucnv_setFallback(UConverter *cnv, UBool usesFallback)
Sets the converter to use fallback mappings or not.
U_CAPI int8_t ucnv_getMinCharSize(const UConverter *converter)
Returns the minimum byte length (per codepoint) for characters in this codepage.
U_CAPI void ucnv_reset(UConverter *converter)
Resets the state of a converter to the default state.
U_CAPI const char * ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode)
Gives the name of the standard at given index of standard list.
U_CAPI void ucnv_getStarters(const UConverter *converter, UBool starters[256], UErrorCode *err)
Gets the "starter" (lead) bytes for converters of type MBCS.
U_CAPI void ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode)
Fill-up the list of alias names for the given alias.
U_CAPI void ucnv_getToUCallBack(const UConverter *converter, UConverterToUCallback *action, const void **context)
Gets the current callback function used by the converter when an illegal or invalid codepage sequence...
U_CAPI 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...
U_CAPI 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.
U_CAPI 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...
U_CAPI 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.
U_CAPI UConverterType ucnv_getType(const UConverter *converter)
Gets the type of the converter e.g.
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:201
U_CAPI 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.
U_CAPI uint16_t ucnv_countStandards(void)
Gives the number of standards associated to converter names.
U_CAPI void ucnv_setSubstChars(UConverter *converter, const char *subChars, int8_t len, UErrorCode *err)
Sets the substitution chars when converting from unicode to a codepage.
U_CAPI UConverter * ucnv_openCCSID(int32_t codepage, UConverterPlatform platform, UErrorCode *err)
Creates a UConverter object from a CCSID number and platform pair.
U_CAPI 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.
U_CAPI int ucnv_compareNames(const char *name1, const char *name2)
Do a fuzzy compare of two converter/alias names.
U_CAPI const char * ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode)
Gives the name of the alias at given index of alias list.
U_CAPI const char * ucnv_getAvailableName(int32_t n)
Gets the canonical converter name of the specified converter from a list of all available converters ...
U_CAPI 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.
U_CAPI int32_t ucnv_countAvailable(void)
Returns the number of available converters, as per the alias file.
U_CAPI 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.
U_CAPI const char * ucnv_getDefaultName(void)
Returns the current default converter name.
UConverterPlatform
Enum for specifying which platform a converter ID refers to.
Definition: ucnv.h:181
U_CAPI UConverter * ucnv_openU(const UChar *name, UErrorCode *err)
Creates a Unicode converter with the names specified as unicode string.
U_CAPI 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.
U_CAPI 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.
U_CAPI int32_t ucnv_getCCSID(const UConverter *converter, UErrorCode *err)
Gets a codepage number associated with the converter.
U_CAPI 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.
U_CAPI 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...
U_CAPI uint16_t ucnv_countAliases(const char *alias, UErrorCode *pErrorCode)
Gives the number of aliases for a given converter or alias name.
U_CAPI void ucnv_setSubstString(UConverter *cnv, const UChar *s, int32_t length, UErrorCode *err)
Set a substitution string for converting from Unicode to a charset.
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:224
U_CAPI 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 ...
UConverterType
Enum for specifying basic types of converters.
Definition: ucnv.h:93
@ UCNV_HZ
Definition: ucnv.h:146
@ UCNV_LMBCS_11
Definition: ucnv.h:134
@ UCNV_ISO_2022
Definition: ucnv.h:117
@ UCNV_LATIN_1
Definition: ucnv.h:103
@ UCNV_COMPOUND_TEXT
Definition: ucnv.h:166
@ UCNV_LMBCS_19
Definition: ucnv.h:142
@ UCNV_UTF32_BigEndian
Definition: ucnv.h:111
@ UCNV_LMBCS_17
Definition: ucnv.h:138
@ UCNV_LMBCS_6
Definition: ucnv.h:130
@ UCNV_UTF32
Definition: ucnv.h:160
@ UCNV_ISCII
Definition: ucnv.h:150
@ UCNV_LMBCS_3
Definition: ucnv.h:124
@ UCNV_IMAP_MAILBOX
Definition: ucnv.h:164
@ UCNV_UTF8
Definition: ucnv.h:105
@ UCNV_SBCS
Definition: ucnv.h:97
@ UCNV_UTF16_LittleEndian
Definition: ucnv.h:109
@ UCNV_UNSUPPORTED_CONVERTER
Definition: ucnv.h:95
@ UCNV_LMBCS_16
Definition: ucnv.h:136
@ UCNV_UTF32_LittleEndian
Definition: ucnv.h:113
@ UCNV_LMBCS_8
Definition: ucnv.h:132
@ UCNV_US_ASCII
Definition: ucnv.h:152
@ UCNV_LMBCS_2
Definition: ucnv.h:122
@ UCNV_UTF16
Definition: ucnv.h:158
@ UCNV_UTF16_BigEndian
Definition: ucnv.h:107
@ UCNV_LMBCS_5
Definition: ucnv.h:128
@ UCNV_EBCDIC_STATEFUL
Definition: ucnv.h:115
@ UCNV_MBCS
Definition: ucnv.h:101
@ UCNV_LMBCS_4
Definition: ucnv.h:126
@ UCNV_SCSU
Definition: ucnv.h:148
@ UCNV_UTF7
Definition: ucnv.h:154
@ UCNV_LMBCS_18
Definition: ucnv.h:140
@ UCNV_BOCU1
Definition: ucnv.h:156
@ UCNV_LMBCS_LAST
Definition: ucnv.h:144
@ UCNV_LMBCS_1
Definition: ucnv.h:120
@ UCNV_DBCS
Definition: ucnv.h:99
@ UCNV_CESU8
Definition: ucnv.h:162
U_CAPI UEnumeration * ucnv_openAllNames(UErrorCode *pErrorCode)
Returns a UEnumeration to enumerate all of the canonical converter names, as per the alias file,...
U_CAPI const char * ucnv_getName(const UConverter *converter, UErrorCode *err)
Gets the internal, canonical name of the converter (zero-terminated).
U_CAPI 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.
U_CAPI 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.
U_CAPI void ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen)
Fixes the backslash character mismapping.
U_CAPI void ucnv_close(UConverter *converter)
Deletes the unicode converter and releases resources associated with just this instance.
U_CAPI const char * ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode)
Returns a standard name for a given converter name.
U_CAPI UConverter * ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err)
U_CAPI void ucnv_resetToUnicode(UConverter *converter)
Resets the to-Unicode part of a converter state to the default state.
U_CAPI 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 ...
U_CAPI 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...
U_CAPI UConverterPlatform ucnv_getPlatform(const UConverter *converter, UErrorCode *err)
Gets a codepage platform associated with the converter.
C UConverter predefined error callbacks.
struct UConverter UConverter
Definition: ucnv_err.h:96
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:157
C API: String Enumeration.
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:44
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:467
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition: umachine.h:86
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:418
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition: umachine.h:85
struct USet USet
USet is the C API type corresponding to C++ class UnicodeSet.
Definition: uset.h:50
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415