ICU 60.2 60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

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 #ifndef __USET_H__
57
67 struct USet;
69 typedef struct USet USet;
70
71 #endif
72
73 #if !UCONFIG_NO_CONVERSION
74
75 U_CDECL_BEGIN
76
78 #define UCNV_MAX_CONVERTER_NAME_LENGTH 60
79
80 #define UCNV_MAX_FULL_FILE_NAME_LENGTH (600+UCNV_MAX_CONVERTER_NAME_LENGTH)
81
83 #define UCNV_SI 0x0F
84
85 #define UCNV_SO 0x0E
86
92 typedef enum {
94 UCNV_UNSUPPORTED_CONVERTER = -1,
96 UCNV_SBCS = 0,
98 UCNV_DBCS = 1,
100 UCNV_MBCS = 2,
102 UCNV_LATIN_1 = 3,
104 UCNV_UTF8 = 4,
106 UCNV_UTF16_BigEndian = 5,
108 UCNV_UTF16_LittleEndian = 6,
110 UCNV_UTF32_BigEndian = 7,
112 UCNV_UTF32_LittleEndian = 8,
114 UCNV_EBCDIC_STATEFUL = 9,
116 UCNV_ISO_2022 = 10,
117
119 UCNV_LMBCS_1 = 11,
121 UCNV_LMBCS_2,
123 UCNV_LMBCS_3,
125 UCNV_LMBCS_4,
127 UCNV_LMBCS_5,
129 UCNV_LMBCS_6,
131 UCNV_LMBCS_8,
133 UCNV_LMBCS_11,
135 UCNV_LMBCS_16,
137 UCNV_LMBCS_17,
139 UCNV_LMBCS_18,
141 UCNV_LMBCS_19,
143 UCNV_LMBCS_LAST = UCNV_LMBCS_19,
145 UCNV_HZ,
147 UCNV_SCSU,
149 UCNV_ISCII,
151 UCNV_US_ASCII,
153 UCNV_UTF7,
155 UCNV_BOCU1,
157 UCNV_UTF16,
159 UCNV_UTF32,
161 UCNV_CESU8,
163 UCNV_IMAP_MAILBOX,
165 UCNV_COMPOUND_TEXT,
166
167 /* Number of converter types for which we have conversion routines. */
168 UCNV_NUMBER_OF_SUPPORTED_CONVERTER_TYPES
169 } UConverterType;
170
180 typedef enum {
181 UCNV_UNKNOWN = -1,
182 UCNV_IBM = 0
183 } UConverterPlatform;
184
200 typedef void (U_EXPORT2 *UConverterToUCallback) (
201 const void* context,
202 UConverterToUnicodeArgs *args,
203 const char *codeUnits,
204 int32_t length,
205 UConverterCallbackReason reason,
206 UErrorCode *pErrorCode);
207
223 typedef void (U_EXPORT2 *UConverterFromUCallback) (
224 const void* context,
225 UConverterFromUnicodeArgs *args,
226 const UChar* codeUnits,
227 int32_t length,
228 UChar32 codePoint,
229 UConverterCallbackReason reason,
230 UErrorCode *pErrorCode);
231
232 U_CDECL_END
233
239 #define UCNV_OPTION_SEP_CHAR ','
240
246 #define UCNV_OPTION_SEP_STRING ","
247
253 #define UCNV_VALUE_SEP_CHAR '='
254
260 #define UCNV_VALUE_SEP_STRING "="
261
270 #define UCNV_LOCALE_OPTION_STRING ",locale="
271
283 #define UCNV_VERSION_OPTION_STRING ",version="
284
295 #define UCNV_SWAP_LFNL_OPTION_STRING ",swaplfnl"
296
312 U_STABLE int U_EXPORT2
313 ucnv_compareNames(const char *name1, const char *name2);
314
315
366 U_STABLE UConverter* U_EXPORT2
367 ucnv_open(const char *converterName, UErrorCode *err);
368
369
396 U_STABLE UConverter* U_EXPORT2
397 ucnv_openU(const UChar *name,
398 UErrorCode *err);
399
464 U_STABLE UConverter* U_EXPORT2
465 ucnv_openCCSID(int32_t codepage,
466 UConverterPlatform platform,
467 UErrorCode * err);
468
499 U_STABLE UConverter* U_EXPORT2
500 ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err);
501
541 U_STABLE UConverter * U_EXPORT2
542 ucnv_safeClone(const UConverter *cnv,
543 void *stackBuffer,
544 int32_t *pBufferSize,
545 UErrorCode *status);
546
547 #ifndef U_HIDE_DEPRECATED_API
548
555 #define U_CNV_SAFECLONE_BUFFERSIZE 1024
556
557 #endif /* U_HIDE_DEPRECATED_API */
558
570 U_STABLE void U_EXPORT2
571 ucnv_close(UConverter * converter);
572
573 #if U_SHOW_CPLUSPLUS_API
574
575 U_NAMESPACE_BEGIN
576
586 U_DEFINE_LOCAL_OPEN_POINTER(LocalUConverterPointer, UConverter, ucnv_close);
587
588 U_NAMESPACE_END
589
590 #endif
591
609 U_STABLE void U_EXPORT2
610 ucnv_getSubstChars(const UConverter *converter,
611 char *subChars,
612 int8_t *len,
613 UErrorCode *err);
614
634 U_STABLE void U_EXPORT2
635 ucnv_setSubstChars(UConverter *converter,
636 const char *subChars,
637 int8_t len,
638 UErrorCode *err);
639
667 U_STABLE void U_EXPORT2
668 ucnv_setSubstString(UConverter *cnv,
669 const UChar *s,
670 int32_t length,
671 UErrorCode *err);
672
686 U_STABLE void U_EXPORT2
687 ucnv_getInvalidChars(const UConverter *converter,
688 char *errBytes,
689 int8_t *len,
690 UErrorCode *err);
691
705 U_STABLE void U_EXPORT2
706 ucnv_getInvalidUChars(const UConverter *converter,
707 UChar *errUChars,
708 int8_t *len,
709 UErrorCode *err);
710
718 U_STABLE void U_EXPORT2
719 ucnv_reset(UConverter *converter);
720
729 U_STABLE void U_EXPORT2
730 ucnv_resetToUnicode(UConverter *converter);
731
740 U_STABLE void U_EXPORT2
741 ucnv_resetFromUnicode(UConverter *converter);
742
793 U_STABLE int8_t U_EXPORT2
794 ucnv_getMaxCharSize(const UConverter *converter);
795
815 #define UCNV_GET_MAX_BYTES_FOR_STRING(length, maxCharSize) \
816 (((int32_t)(length)+10)*(int32_t)(maxCharSize))
817
826 U_STABLE int8_t U_EXPORT2
827 ucnv_getMinCharSize(const UConverter *converter);
828
843 U_STABLE int32_t U_EXPORT2
844 ucnv_getDisplayName(const UConverter *converter,
845 const char *displayLocale,
846 UChar *displayName,
847 int32_t displayNameCapacity,
848 UErrorCode *err);
849
860 U_STABLE const char * U_EXPORT2
861 ucnv_getName(const UConverter *converter, UErrorCode *err);
862
886 U_STABLE int32_t U_EXPORT2
887 ucnv_getCCSID(const UConverter *converter,
888 UErrorCode *err);
889
900 U_STABLE UConverterPlatform U_EXPORT2
901 ucnv_getPlatform(const UConverter *converter,
902 UErrorCode *err);
903
912 U_STABLE UConverterType U_EXPORT2
913 ucnv_getType(const UConverter * converter);
914
930 U_STABLE void U_EXPORT2
931 ucnv_getStarters(const UConverter* converter,
932 UBool starters[256],
933 UErrorCode* err);
934
935
941 typedef enum UConverterUnicodeSet {
943 UCNV_ROUNDTRIP_SET,
945 UCNV_ROUNDTRIP_AND_FALLBACK_SET,
946 #ifndef U_HIDE_DEPRECATED_API
947
951 UCNV_SET_COUNT
952 #endif // U_HIDE_DEPRECATED_API
953 } UConverterUnicodeSet;
954
955
1001 U_STABLE void U_EXPORT2
1002 ucnv_getUnicodeSet(const UConverter *cnv,
1003 USet *setFillIn,
1004 UConverterUnicodeSet whichSet,
1005 UErrorCode *pErrorCode);
1006
1018 U_STABLE void U_EXPORT2
1019 ucnv_getToUCallBack (const UConverter * converter,
1020 UConverterToUCallback *action,
1021 const void **context);
1022
1034 U_STABLE void U_EXPORT2
1035 ucnv_getFromUCallBack (const UConverter * converter,
1036 UConverterFromUCallback *action,
1037 const void **context);
1038
1054 U_STABLE void U_EXPORT2
1055 ucnv_setToUCallBack (UConverter * converter,
1056 UConverterToUCallback newAction,
1057 const void* newContext,
1058 UConverterToUCallback *oldAction,
1059 const void** oldContext,
1060 UErrorCode * err);
1061
1077 U_STABLE void U_EXPORT2
1078 ucnv_setFromUCallBack (UConverter * converter,
1079 UConverterFromUCallback newAction,
1080 const void *newContext,
1081 UConverterFromUCallback *oldAction,
1082 const void **oldContext,
1083 UErrorCode * err);
1084
1143 U_STABLE void U_EXPORT2
1144 ucnv_fromUnicode (UConverter * converter,
1145 char **target,
1146 const char *targetLimit,
1147 const UChar ** source,
1148 const UChar * sourceLimit,
1149 int32_t* offsets,
1150 UBool flush,
1151 UErrorCode * err);
1152
1212 U_STABLE void U_EXPORT2
1213 ucnv_toUnicode(UConverter *converter,
1214 UChar **target,
1215 const UChar *targetLimit,
1216 const char **source,
1217 const char *sourceLimit,
1218 int32_t *offsets,
1219 UBool flush,
1220 UErrorCode *err);
1221
1249 U_STABLE int32_t U_EXPORT2
1250 ucnv_fromUChars(UConverter *cnv,
1251 char *dest, int32_t destCapacity,
1252 const UChar *src, int32_t srcLength,
1253 UErrorCode *pErrorCode);
1254
1281 U_STABLE int32_t U_EXPORT2
1282 ucnv_toUChars(UConverter *cnv,
1283 UChar *dest, int32_t destCapacity,
1284 const char *src, int32_t srcLength,
1285 UErrorCode *pErrorCode);
1286
1357 U_STABLE UChar32 U_EXPORT2
1358 ucnv_getNextUChar(UConverter * converter,
1359 const char **source,
1360 const char * sourceLimit,
1361 UErrorCode * err);
1362
1501 U_STABLE void U_EXPORT2
1502 ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
1503 char **target, const char *targetLimit,
1504 const char **source, const char *sourceLimit,
1505 UChar *pivotStart, UChar **pivotSource,
1506 UChar **pivotTarget, const UChar *pivotLimit,
1507 UBool reset, UBool flush,
1508 UErrorCode *pErrorCode);
1509
1565 U_STABLE int32_t U_EXPORT2
1566 ucnv_convert(const char *toConverterName,
1567 const char *fromConverterName,
1568 char *target,
1569 int32_t targetCapacity,
1570 const char *source,
1571 int32_t sourceLength,
1572 UErrorCode *pErrorCode);
1573
1619 U_STABLE int32_t U_EXPORT2
1620 ucnv_toAlgorithmic(UConverterType algorithmicType,
1621 UConverter *cnv,
1622 char *target, int32_t targetCapacity,
1623 const char *source, int32_t sourceLength,
1624 UErrorCode *pErrorCode);
1625
1671 U_STABLE int32_t U_EXPORT2
1672 ucnv_fromAlgorithmic(UConverter *cnv,
1673 UConverterType algorithmicType,
1674 char *target, int32_t targetCapacity,
1675 const char *source, int32_t sourceLength,
1676 UErrorCode *pErrorCode);
1677
1685 U_STABLE int32_t U_EXPORT2
1686 ucnv_flushCache(void);
1687
1695 U_STABLE int32_t U_EXPORT2
1696 ucnv_countAvailable(void);
1697
1708 U_STABLE const char* U_EXPORT2
1709 ucnv_getAvailableName(int32_t n);
1710
1723 U_STABLE UEnumeration * U_EXPORT2
1724 ucnv_openAllNames(UErrorCode *pErrorCode);
1725
1736 U_STABLE uint16_t U_EXPORT2
1737 ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
1738
1751 U_STABLE const char * U_EXPORT2
1752 ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
1753
1767 U_STABLE void U_EXPORT2
1768 ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode);
1769
1793 U_STABLE UEnumeration * U_EXPORT2
1794 ucnv_openStandardNames(const char *convName,
1795 const char *standard,
1796 UErrorCode *pErrorCode);
1797
1803 U_STABLE uint16_t U_EXPORT2
1804 ucnv_countStandards(void);
1805
1813 U_STABLE const char * U_EXPORT2
1814 ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode);
1815
1835 U_STABLE const char * U_EXPORT2
1836 ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode);
1837
1857 U_STABLE const char * U_EXPORT2
1858 ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErrorCode);
1859
1874 U_STABLE const char * U_EXPORT2
1875 ucnv_getDefaultName(void);
1876
1877 #ifndef U_HIDE_SYSTEM_API
1878
1894 U_STABLE void U_EXPORT2
1895 ucnv_setDefaultName(const char *name);
1896 #endif /* U_HIDE_SYSTEM_API */
1897
1915 U_STABLE void U_EXPORT2
1916 ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen);
1917
1926 U_STABLE UBool U_EXPORT2
1927 ucnv_isAmbiguous(const UConverter *cnv);
1928
1944 U_STABLE void U_EXPORT2
1945 ucnv_setFallback(UConverter *cnv, UBool usesFallback);
1946
1956 U_STABLE UBool U_EXPORT2
1957 ucnv_usesFallback(const UConverter *cnv);
1958
1988 U_STABLE const char* U_EXPORT2
1989 ucnv_detectUnicodeSignature(const char* source,
1990 int32_t sourceLength,
1991 int32_t *signatureLength,
1992 UErrorCode *pErrorCode);
1993
2005 U_STABLE int32_t U_EXPORT2
2006 ucnv_fromUCountPending(const UConverter* cnv, UErrorCode* status);
2007
2019 U_STABLE int32_t U_EXPORT2
2020 ucnv_toUCountPending(const UConverter* cnv, UErrorCode* status);
2021
2037 U_STABLE UBool U_EXPORT2
2038 ucnv_isFixedWidth(UConverter *cnv, UErrorCode *status);
2039
2040 #endif
2041
2042 #endif
2043 /*_UCNV*/
UConverterToUnicodeArgs
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:210
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_usesFallback
UBool ucnv_usesFallback(const UConverter *cnv)
Determines if the converter uses fallback mappings or not.
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.
UCNV_LMBCS_11
Definition: ucnv.h:133
UConverterCallbackReason
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:157
UCNV_COMPOUND_TEXT
Definition: ucnv.h:165
ucnv_fromUCountPending
int32_t ucnv_fromUCountPending(const UConverter *cnv, UErrorCode *status)
Returns the number of UChars held in the converter&#39;s internal state because more input is needed for ...
ucnv_toUCountPending
int32_t ucnv_toUCountPending(const UConverter *cnv, UErrorCode *status)
Returns the number of chars held in the converter&#39;s internal state because more input is needed for c...
ucnv_compareNames
int ucnv_compareNames(const char *name1, const char *name2)
Do a fuzzy compare of two converter/alias names.
UCNV_LMBCS_17
Definition: ucnv.h:137
ucnv_getStandard
const char * ucnv_getStandard(uint16_t n, UErrorCode *pErrorCode)
Gives the name of the standard at given index of standard list.
ucnv_countStandards
uint16_t ucnv_countStandards(void)
Gives the number of standards associated to converter names.
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_resetFromUnicode
void ucnv_resetFromUnicode(UConverter *converter)
Resets the from-Unicode part of a converter state to the default state.
UCNV_LMBCS_2
Definition: ucnv.h:121
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_getType
UConverterType ucnv_getType(const UConverter *converter)
Gets the type of the converter e.g.
UCNV_LMBCS_4
Definition: ucnv.h:125
UCNV_LMBCS_8
Definition: ucnv.h:131
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_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 ...
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:43
UCNV_SET_COUNT
Number of UConverterUnicodeSet selectors.
Definition: ucnv.h:951
UCNV_SBCS
Definition: ucnv.h:96
UCNV_UTF32_LittleEndian
Definition: ucnv.h:112
ucnv_getCCSID
int32_t ucnv_getCCSID(const UConverter *converter, UErrorCode *err)
Gets a codepage number associated with the converter.
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. ...
LocalUConverterPointer
"Smart pointer" class, closes a UConverter via ucnv_close().
UCNV_UTF32_BigEndian
Definition: ucnv.h:110
ucnv_openCCSID
UConverter * ucnv_openCCSID(int32_t codepage, UConverterPlatform platform, UErrorCode *err)
Creates a UConverter object from a CCSID number and platform pair.
UCNV_LMBCS_16
Definition: ucnv.h:135
UConverterFromUnicodeArgs
The structure for the fromUnicode callback function parameter.
Definition: ucnv_err.h:194
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:200
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_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_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_openPackage
UConverter * ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err)
U_CDECL_BEGIN
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition: umachine.h:84
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_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...
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 ...
ucnv_countAvailable
int32_t ucnv_countAvailable(void)
Returns the number of available converters, as per the alias file.
UCNV_LMBCS_3
Definition: ucnv.h:123
UCNV_MBCS
Definition: ucnv.h:100
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...
ucnv_isAmbiguous
UBool ucnv_isAmbiguous(const UConverter *cnv)
Determines if the converter contains ambiguous mappings of the same character or not.
UCNV_US_ASCII
Definition: ucnv.h:151
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
UCNV_ISCII
Definition: ucnv.h:149
UCNV_DBCS
Definition: ucnv.h:98
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:487
UCNV_EBCDIC_STATEFUL
Definition: ucnv.h:114
UCNV_LMBCS_18
Definition: ucnv.h:139
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:223
UConverterUnicodeSet
UConverterUnicodeSet
Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet().
Definition: ucnv.h:941
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_getAliases
void ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode)
Fill-up the list of alias names for the given alias.
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
ucnv_countAliases
uint16_t ucnv_countAliases(const char *alias, UErrorCode *pErrorCode)
Gives the number of aliases for a given converter or alias name.
ucnv_setDefaultName
void ucnv_setDefaultName(const char *name)
This function is not thread safe.
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:396
ucnv_getPlatform
UConverterPlatform ucnv_getPlatform(const UConverter *converter, UErrorCode *err)
Gets a codepage platform associated with the converter.
UCNV_LMBCS_19
Definition: ucnv.h:141
UCNV_UNSUPPORTED_CONVERTER
Definition: ucnv.h:94
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_ISO_2022
Definition: ucnv.h:116
ucnv_reset
void ucnv_reset(UConverter *converter)
Resets the state of a converter to the default state.
UCNV_HZ
Definition: ucnv.h:145
ucnv_setFallback
void ucnv_setFallback(UConverter *cnv, UBool usesFallback)
Sets the converter to use fallback mappings or not.
ucnv_safeClone
UConverter * ucnv_safeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
Thread safe converter cloning operation.
UCNV_ROUNDTRIP_SET
Select the set of roundtrippable Unicode code points.
Definition: ucnv.h:943
UCNV_UTF16_LittleEndian
Definition: ucnv.h:108
UCNV_ROUNDTRIP_AND_FALLBACK_SET
Select the set of Unicode code points with roundtrip or fallback mappings.
Definition: ucnv.h:945
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_CESU8
Definition: ucnv.h:161
UCNV_UTF32
Definition: ucnv.h:159
UCNV_SCSU
Definition: ucnv.h:147
UChar
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:349
UCNV_LATIN_1
Definition: ucnv.h:102
UCNV_BOCU1
Definition: ucnv.h:155
U_CDECL_END
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition: umachine.h:85
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
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...
UCNV_LMBCS_LAST
Definition: ucnv.h:143
USet
struct USet USet
Definition: ucnv.h:69
ucnv_getName
const char * ucnv_getName(const UConverter *converter, UErrorCode *err)
Gets the internal, canonical name of the converter (zero-terminated).
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.
UCNV_UTF8
Definition: ucnv.h:104
ucnv_resetToUnicode
void ucnv_resetToUnicode(UConverter *converter)
Resets the to-Unicode part of a converter state to the default state.
UCNV_LMBCS_6
Definition: ucnv.h:129
UConverter
struct UConverter UConverter
Definition: ucnv_err.h:96
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
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.
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_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.
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.
uenum.h
C API: String Enumeration.
ucnv_close
void ucnv_close(UConverter *converter)
Deletes the unicode converter and releases resources associated with just this instance.
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_LMBCS_5
Definition: ucnv.h:127
UConverterType
UConverterType
Enum for specifying basic types of converters.
Definition: ucnv.h:92
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_UTF7
Definition: ucnv.h:153
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_fixFileSeparator
void ucnv_fixFileSeparator(const UConverter *cnv, UChar *source, int32_t sourceLen)
Fixes the backslash character mismapping.
UCNV_LMBCS_1
Definition: ucnv.h:119
ucnv_err.h
C UConverter predefined error callbacks.
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
Definition: ucnv.h:157
ucnv_flushCache
int32_t ucnv_flushCache(void)
Frees up memory occupied by unused, cached converter shared data.
ucnv_getStandardName
const char * ucnv_getStandardName(const char *name, const char *standard, UErrorCode *pErrorCode)
Returns a standard name for a given converter name.
ucnv_getMinCharSize
int8_t ucnv_getMinCharSize(const UConverter *converter)
Returns the minimum byte length (per codepoint) for characters in this codepage.
UConverterPlatform
UConverterPlatform
Enum for specifying which platform a converter ID refers to.
Definition: ucnv.h:180
ucnv_getDefaultName
const char * ucnv_getDefaultName(void)
Returns the current default converter name.
UCNV_IMAP_MAILBOX
Definition: ucnv.h:163
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...
ucnv_openAllNames
UEnumeration * ucnv_openAllNames(UErrorCode *pErrorCode)
Returns a UEnumeration to enumerate all of the canonical converter names, as per the alias file...
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.
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:236
UCNV_UTF16_BigEndian
Definition: ucnv.h:106