/* ********************************************************************** * Copyright (C) 2000-2004, X.Net, Inc. Lafayette, California, USA * All Rights Reserved. * * Open source license http://www.opensource.org/licenses/xnet.html ********************************************************************** * xiua.h: * External APIs for the ICU's codeset conversion library * * * Modification History: * * Date Name Description * 04/19/00 brown Initial version. * 04/24/00 brown docs & UTF-8. * 04/27/00 brown Use ICU utypes for x-platform simplicity * add time parm to Cdate * Dual role DSO-DLL & direct link header * 05/09/00 brown Add Apache I/O services * 05/24/00 brown Add directory parsing and locale verification * 06/02/00 brown Add Fix date * 06/05/00 brown Add UTF16 converter * 06/09/00 brown Add find locale * 08/27/00 brown Update for ICU 1.6 * 11/12/00 brown Add direct UTF-8 to Char support & multi-mode * 08/02/01 brown xIUA 3.0 initial testing complete * 10/08/01 brown/maynard const fixes * 10/10/01 brown xIUA 3.1 complete * 12/06/01 brown xIUA 3.2 complete * 10/03/02 brown xIUA 3.3 complete * 12/17/02 brown xIUA 3.4 complete * 06/14/03 brown xIUA 3.5 complete (ICU 2.6 support) * 02/05/04 brown xIUA 3.6 complete (ICU 2.8 support) * 02/22/04 brown Filter times zones and build tz offset table */ /** * XIUA C API */ #ifndef XIUA_H #define XIUA_H #include #include #include "unicode/utypes.h" #include "unicode/udat.h" #include "unicode/unum.h" #include "unicode/parseerr.h" #if (U_ICU_VERSION_MAJOR_NUM < 2) #if (U_ICU_VERSION_MINOR_NUM < 9) #define XIUA_ICU_LEVEL 0 #else #define XIUA_ICU_LEVEL 1 #endif #else #if (U_ICU_VERSION_MINOR_NUM ==0) #define XIUA_ICU_LEVEL 2 #elif (U_ICU_VERSION_MINOR_NUM ==1) #define XIUA_ICU_LEVEL 3 #elif (U_ICU_VERSION_MINOR_NUM < 7) #define XIUA_ICU_LEVEL 4 #else #define XIUA_ICU_LEVEL 5 #endif #endif typedef void *XMTX; #define U_CAPIX U_CAPI #define U_EXPORTX U_EXPORT2 #ifndef UChar16 #define UChar16 UChar #endif #ifndef UChar8 #define UChar8 unsigned char /* #define UChar8 char */ #endif #define CpChar unsigned char /* #define CpChar char */ #define UChar8U unsigned char #define CpCharU unsigned char #ifndef U_STRING_NOT_TERMINATED_WARNING #define U_STRING_NOT_TERMINATED_WARNING -124 #endif #ifndef U_USING_FALLBACK_WARNING #define U_USING_FALLBACK_WARNING -128 #endif #define U_LOCALE_REOPENED_WARNING -99; #define XIUA_MAXLOCALESIZE 23 #define XIUA_MAXCHARSETSIZE 41 #define XIUA_MAXTIMEZONESIZE 32 #define XIUA_MAXPOSIXLOCALESIZE XIUA_MAXLOCALESIZE+XIUA_MAXCHARSETSIZE #define XIUA_MAXFULLLOCALESIZE XIUA_MAXPOSIXLOCALESIZE+XIUA_MAXTIMEZONESIZE enum XIUA_DataFormat { XDFANY = 0, /* any data format */ XDFUTF16 = 1, /* UCS-2/UFT-16 data */ XDFUTF32 = 2, /* UCS-4/UFT-32 data */ XDFUTF8 = 3, /* UFT-8 data */ XDFCODEPAGE = 4, /* Codepage data */ XDFCPWIN = 5, /* Windows codepage data */ XDFCPUNIX = 6, /* Unix codepage data */ XDFCPMAC = 7, /* Mac codepage data */ XDFCPOSA = 8, /* Other OS (A) codepage data */ XDFCPOSB = 9 /* Other OS (B) codepage data */ }; #ifndef XP_CPLUSPLUS typedef enum XIUA_DataFormat XIUA_DataFormat; #endif enum XIUA_LocaleClass { XLCNONE = -1, /* No class */ XLCDEFAULT = 0, /* Default locale */ XLCPRIMARY = 1, /* Primary locale */ XLCSECONDARY = 2, /* Secondary locale */ XLCDATABASE = 3, /* Database locale */ XLCSQL = 4, /* SQL locale */ XLCHTML = 5, /* HTML locale */ XLCBROWSER = 6, /* Browser locale */ XLCMAX = 6, /* Max locale clases*/ }; #ifndef XP_CPLUSPLUS typedef enum XIUA_LocaleClass XIUA_LocaleClass; #endif enum XIUA_CodeSet { XCP1BYTE = 0, /* Single Byte */ XCPSJIS = 1, /* Shift JIS CP932*/ XCPKSC = 2, /* KSC_5601 CP949*/ XCPBIG5 = 3, /* Big 5 CP950*/ XCP936 = 4, /* CP936 */ XCPEUCJP = 5, /* EUC_JP */ XCPEUCKR = 6, /* EUC_KR */ XCPEUCTW = 7, /* EUC_TW */ XCPEUCCN = 8, /* EUC_CN GB3212*/ XCPGB18030 = 9, /* GB18030 */ XCP2022 = 10, /* 2022 */ XCP2022J = 11, /* 2022_JP */ XCP2022K = 12, /* 2022_KR */ XCP2022C = 13, /* 2022_CN */ XCPUTF8 = 14, /* UTF-8 */ XCPMAX = 14 /* Max codeset */ }; #ifndef XP_CPLUSPLUS typedef enum XIUA_CodeSet XIUA_CodeSet; #endif enum XIUA_InvalidChar { XICSKIP = 0, /* Skip bad characters */ XICSUBSTITUTE = 1, /* Use substitute character*/ XICSTOP = 2, /* Stop the conversion*/ XICFROM_U_ESCAPE_ICU = 3, /* Use ICU escape Unicode to Char*/ XICTO_U_ESCAPE_ICU = 4, /* Use ICU escape Char to Unicode*/ XICFROM_U_ESCAPE_JAVA = 5, /* Use JAVA escape Unicode to Char*/ XICTO_U_ESCAPE_JAVA = 6, /* Use JAVA escape Char to Unicode*/ XICFROM_U_ESCAPE_C = 7, /* Use C escape Unicode to Char*/ XICTO_U_ESCAPE_C = 8, /* Use C escape Char to Unicode*/ XICFROM_U_ESCAPE_XML_DEC = 9, /* Use HTML/XML decimal escape Unicode to Char*/ XICTO_U_ESCAPE_XML_DEC = 10, /* Use HTML/XML decimal escape Char to Unicode*/ XICFROM_U_ESCAPE_XML_HEX = 11, /* Use HTML/XML hex escape Unicode to Char*/ XICTO_U_ESCAPE_XML_HEX = 12, /* Use HTML/XML hex escape Char to Unicode*/ XICNO_FALLBACK = 13, /* Do not use fallback conversion characters*/ XICUSE_FALLBACK = 14, /* Use fallback conversion characters*/ }; /* xIUA defaults are XICSUBSTITUTE and XICUSE_FALLBACK */ #ifndef XP_CPLUSPLUS typedef enum XIUA_InvalidChar XIUA_InvalidChar; #endif enum XIUA_DateFormat { XDTNONE = UDAT_NONE, /* None */ XDTFULL = UDAT_FULL, /* Full date or time */ XDTLONG = UDAT_LONG, /* Long date or time */ XDTMEDIUM = UDAT_MEDIUM, /* Medium date or time */ XDTSHORT = UDAT_SHORT, /* Short date or time */ XDTANY = UDAT_SHORT+1 /* Any format */ }; #ifndef XP_CPLUSPLUS typedef enum XIUA_DateFormat XIUA_DateFormat; #endif enum XIUA_LocaleType { XLTFULL = 0, /* Full listing */ XLTCOUNTRY = 1, /* Just locales containing country codes */ XLTLANGUAGE = 2 /* Locales without country codes */ }; #ifndef XP_CPLUSPLUS typedef enum XIUA_LocaleType XIUA_LocaleType; #endif enum XIUA_LocaleList { XLLLOCALE = 0, /* Listing in locale language*/ XLLENGLISH = 1, /* Listing in English */ XLLBOTH = 2 /* Listing in both */ }; #ifndef XP_CPLUSPLUS typedef enum XIUA_LocaleList XIUA_LocaleList; #endif enum XIUA_NumFormat { XNFDECIMAL = UNUM_DECIMAL, /* Decimal format */ XNFCURRENCY = UNUM_CURRENCY, /* Currency format*/ XNFPERCENT = UNUM_PERCENT, /* Percent format */ XNFANY = UNUM_SPELLOUT+1 /* Any format*/ }; #ifndef XP_CPLUSPLUS typedef enum XIUA_NumFormat XIUA_NumFormat; #endif enum XIUA_CollStrength { XCOL_PRIMARY = 0, /* Strength 1 */ XCOL_SECONDARY = 1, /* Strength 2 */ XCOL_TERTIARY = 2, /* Strength 3 */ XCOL_QUATERNARY = 3, /* Strength 4 */ }; #ifndef XP_CPLUSPLUS typedef enum XIUA_CollStrength XIUA_CollStrength; #endif /** Locale check iterations **/ enum XIUA_LocIterate { /** iterate within language iterate as below and then try just language without country or variant*/ XLOC_MATCH_LANG = 0, /** iterate country without variant if country valid then iterate country as first variant (if country length > 2)*/ XLOC_MATCH_SUBLANG = 1, /** iterate country as first variant only (if country length > 2)*/ XLOC_MATCH_VARIANT = 2, /** do not iterate **/ XLOC_MATCH_EXACT = 3 }; #ifndef XP_CPLUSPLUS typedef enum XIUA_LocIterate XIUA_LocIterate; #endif /* * Structure for locale. */ typedef struct { void * next; void * prev; void * thread; const char *locale; const char *charset; const char *tzone; void *conv; XIUA_DataFormat open_format; XIUA_DataFormat format; XIUA_CodeSet codeset; char locale_val[XIUA_MAXLOCALESIZE+1]; char charset_val[XIUA_MAXCHARSETSIZE]; char tzone_val[XIUA_MAXTIMEZONESIZE]; char charset_name[XIUA_MAXCHARSETSIZE]; } XIUA_Locale; /* * Structure for thread. */ typedef struct { XIUA_Locale *Curr_locale; XIUA_Locale *First_locale; XIUA_Locale *Locale_Clases[XLCMAX+1]; char * work_buff; char * save_buff; int work_size; int save_size; char *last_str; UErrorCode status; #if (XIUA_ICU_LEVEL > 0) UParseError ParseStatus; #endif } XIUA_Thread; /* By default xiua_Init and xiua_InitThread are invoked if needed by other functions*/ /* xiua_Init - Explicitly initialze xIUA and ICU*/ U_CAPIX UErrorCode U_EXPORTX xiua_Init(); /* Init XIUA */ /* xiua_InitThread - Explicitly initialze xIUA thread locale storage for this thread*/ U_CAPIX UErrorCode U_EXPORTX xiua_InitThread(); /* Init XIUA thread */ U_CAPIX void U_EXPORTX xiua_Term(); /* Terminate XIUA */ U_CAPIX void U_EXPORTX xiua_TermThread(); /* Terminate XIUA thread */ /* retrieves a pointer to the UErrorCode field use by xIUA functions in the current thread local storage*/ U_CAPIX UErrorCode * U_EXPORTX xiua_CurrentStatus(); /* GetStatus pointer*/ /* Creates a local for this thread and sets it as teh current locale. It it is a duplicate of a previously opened locale, then no new locale is created but that locael is set to be the current locale. The routine returns a handle to the locale that can be used by other routines.*/ /* Note: if the data is in UTF-8 encoding use the XDFUTF8 data format. Do not use utf-8 as the locale character set. This will insure that the functions will always use the proper routines. */ U_CAPIX XIUA_Locale * U_EXPORTX /* new current locale handle */ xiua_OpenLocale(const char * locale, /* ICU/POSIX/RFC-1766(3066) local string */ /* null sets system default */ /* if locale matches open locale */ /* existing locale is set to current */ const XIUA_DataFormat format); /* data format */ /* sets a previously opened locale as current using the handle of the locale*/ U_CAPIX XIUA_Locale * U_EXPORTX /* previous locale handle */ xiua_SetLocaleHdl(const XIUA_Locale * hlocale); /* locale handle */ /* set the specific locale to a locale class designation. If the class was previously set this locale will replace the previous locale. The funstion allows you to retreive a pointer to the locale by class designation. The default class (XLCDEFAULT) is special. You set the locale as the default locale so that xiua_CloseLocale or xiua_CloseLocaleHdl will make this locale current if they are called with set_def set to TRUE. If you close a locale that is set to a class then the class is cleared so that it will return a NULL pointer. If the default class locale is cleared it will set the default class to the previously opend locale. If there is no previous local it will be set to the next locale. It will only be cleared when no locales are open. If default is clear it will be set to the first locale that is opened. */ U_CAPIX XIUA_Locale * U_EXPORTX xiua_SetLocaleClassHdl(const XIUA_Locale * hlocale, /* locale handle */ /* null sets class of current locale */ const XIUA_LocaleClass lclass); /* locale class */ /* Retrieve locale handle by class. */ U_CAPIX XIUA_Locale * U_EXPORTX xiua_GetLocaleClassHdl(const XIUA_LocaleClass lclass); /* locale class */ /* Set invalid character handling. */ U_CAPIX XIUA_Locale * U_EXPORTX xiua_SetLocaleInvalidCharHdl(const XIUA_Locale * hlocale, /* locale handle */ /* null sets class of current locale */ const XIUA_InvalidChar ichar); /* locale invalid character handling */ /* Close routines will attempt to set the next current locale by locale class. If the class is not set then it will set it to the default class locale. If no class is specified (XLCNONE) then it will use the previously opened locale. If there are no previously opened locale it will use the next locale (if any)*/ /* Close a locale by name */ U_CAPIX XIUA_Locale * U_EXPORTX /* new current local handle */ xiua_CloseLocale(const char * locale, /* ICU/POSIX/RFC-1766 local string */ /* null closes current locale */ const XIUA_DataFormat format, /* data format */ const XIUA_LocaleClass lclass); /* locale class to set current */ /* Close a locale by handle */ U_CAPIX XIUA_Locale * U_EXPORTX /* new current local handle */ xiua_CloseLocaleHdl(const XIUA_Locale * locale, /* local handle */ /* null closes current locale */ const XIUA_LocaleClass lclass); /* locale class to set current */ /* Close all open locales */ U_CAPIX void U_EXPORTX xiua_CloseLocaleAll(void); /* Sets the time zone for a locale by locale handle */ U_CAPIX void U_EXPORTX xiua_SetTZone(const XIUA_Locale * hlocale, /* locale handle */ /* null uses current locale */ const char * zonename); /* time zone name string */ /* Returnes the ICU locale string for the locale */ U_CAPIX const char * U_EXPORTX /* returns the current locale string pointer*/ xiua_CurrentLocale(void); /* Get the full name of the locale in a form suitable to be sent to another system doing an xiua_OpenLocale. It uses a POSIX format that has been extended to add time zone: Format: (no spaces) ll [_CC ] [.MM ] [ @VV] [#TT] ll = lang, CC = ctry, MM = charmap, VV = variant, TT = time zone */ U_CAPIX int32_t U_EXPORTX /* returns the length of locale name string */ xiua_GetLocaleName(char * locale, /* POSIX local string */ const int32_t size, /* length of locale string buffer */ const XIUA_Locale * hlocale); /* locale handle */ /* null uses current locale */ /* scans URLs and directory paths for directories that match locales. It will match RFC 3066(1766) language names to locales. It also returns the level within the URL or path that the matching directory was found. */ /* for Windows compatibility it ignores drive letters */ U_CAPIX int32_t U_EXPORTX /* returns the index level of locale in directory */ /* dirLevel = 0 (no locale) , 1 (locale in root), 2 (locale in 2nd level) ... */ /* if more than one locale if found the highest level is used */ xiua_ScanDir(char * locale, /* Sets locale from directory (if found) or unchanged */ /* Must be XIUA_MAXLOCALESIZE or larger. */ const char * dir); /* directory (path part of URI) */ /* Parses a browser accept-language string and returns the highest quality matching string */ U_CAPIX int32_t U_EXPORTX /* length of prefered language */ /* This routine select first language with highest q */ /* whose rfc3066 value matches an ICU locale */ xiua_AcceptLanguage(char * lang, /* best language */ /* Must be XIUA_MAXLOCALESIZE or larger. */ const char * languages); /* browser language list */ /* This routine converts language to locale. This implementation uses the _languageToDefaultlocaleTableX to provide a locale preference order for each language. This is one routine that should probably be specifically adapted to your needs. It would be better to use a database of file to customize the preferences. */ /* the code shows how to use a ZX country code in the ICU data table as one alternative method. However this is not a practical method for most installations */ U_CAPIX void U_EXPORTX xiua_FindLocaleFromLang(char * locale, /* Return the configured default browser locale from browser language specification. */ const char * lang); /* Parses a browser accept-charset string and returns the a POSIX locale with highest quality matching charset that is suitable for the specified locale. "*;q=0n" indicates the quality to use the default charset for the language. In this case a character set is always found.*/ U_CAPIX int32_t U_EXPORTX /* length of prefered language <= 0 if none found*/ /* This routine select first character set with highest q */ /* whose rfc3066 value the language */ xiua_AcceptCharset(char * posix_locale, /* POSIX locale from language string */ /* if no suitable charset is found the default charset is used */ /* Must be XIUA_MAXPOSIXLOCALESIZE or larger. */ const char * locale, /* ICU locale from language string */ const char * charsets); /* browser charset list */ /* Checks locale to see if it is valid. If the return code is U_ZERO_ERROR then it is an exact match to the locale. If a warning return code is returned such as U_USING_FALLBACK_ERROR or U_USING_FALLBACK_WARNING then the locale may not match the same variant or country */ /* The iteration control determines has close a macth you need */ /* XLOC_MATCH_EXACT means that you must have the same language, country and variant */ /* XLOC_MATCH_VARIANT means that if it does not match exactly and the sublanguage is more than 2 bytes (not a country) it will try to use the sublanguage as a variant. For example "es-traditional" will be converted to "es__TRADITIONAL". */ /* XLOC_MATCH_SUBLANG means that you must have the same language and country. "fr_FR_EURO" will give you "fr_FR_EURO" but "fr_FR_FRANC" will give you "fr_FR". */ /* XLOC_MATCH_LANG means that you must have the same language. "en_US" will give you "en_US" but "en_JM" will give you "en" because there is not Jamaican English. */ U_CAPIX UBool U_EXPORTX xiua_ChkLocale(char * target, /* target local string after extract and reformat to standard */ /* locale format - This field is used for validation. */ const char * source, /* source locale string */ /* Pass locale ID xx_YY or xx-YY or XX-yy or xx */ /* xx_YY_ZZZZ variant formats up to 15 characters such as */ const XIUA_LocIterate iterate); /* locale iteration control */ /* This routine returns a list of available locales one at a time. It uses two integer values so that the code is stateless. It will return full locales that inculde a country code or just locales for each specific language or both, */ U_CAPIX int32_t U_EXPORTX /* new (target) string length */ xiua_GetNextLocale(char *target, /* target string */ const int32_t numBytes, /* size of target area */ int32_t * next, /* next locale index */ /* set initially to -1 on first call */ int32_t * max, /* number of available locales */ /* set initially to -1 on first call */ const XIUA_LocaleType type); /* With or without country or both */ /* The display locale routine will build a print line for the specific locale. The line can be build in the current locale language or English or both. The reason for listing in both is to insure that if a user selects a language that he/she has not fonts to render that part of the line will still contain a displayable language name so that the user can reset the language selection to a usable one. */ U_CAPIX int32_t U_EXPORTX /* new (target) string length */ xiua_DisplayLocale(char *target, /* target string */ const int32_t numBytes, /* size of target area */ const char * source, /* locale to display */ const XIUA_LocaleList listlang); /* Locale language or English or both */ U_CAPIX int32_t U_EXPORTX xiu2_DisplayLocale(UChar *target, const int32_t numBytes, const char * source, const XIUA_LocaleList listlang); U_CAPIX int32_t U_EXPORTX xiu4_DisplayLocale(UChar32 *target, const int32_t numBytes, const char * source, const XIUA_LocaleList listlang); U_CAPIX int32_t U_EXPORTX xiu8_DisplayLocale(UChar8 *target, const int32_t numBytes, const char * source, const XIUA_LocaleList listlang); U_CAPIX int32_t U_EXPORTX xicp_DisplayLocale(CpChar *target, const int32_t numBytes, const char * source, const XIUA_LocaleList listlang); /* This routine returns a signed GMT offest for the time zone. If the pointer is NULL it returns the offest for the current locale time zone.*/ /* The offest is the number of seconds that is added to the UDT time to produce the locale time */ U_CAPIX int32_t U_EXPORTX /* time zone offest from GMT in secs */ xiua_GetTZoneOffset(const char *source); /* Time Zone or NULL for default */ /* This routine returns a list of available time zones one at a time. It uses four integer values so that the code is stateless. */ /* If you set numzone to -1 to list all available time zones it starts the list with the current locale time zone and moves East. If you start with Pacfic Standard Time the Hawaii and Alaska times will be at the end of the list. */ /* DUE TO TIME ZONE RESTRUCTURING IN ICU 2.8 OTHER ANOTHER API SHOULD BE USED */ /* Works but very slow performance */ U_CAPIX int32_t U_EXPORTX /* new (target) string length or zero*/ xiua_GetNextTZone(char *target, /* target string */ const int32_t numBytes, /* size of target area */ int32_t * numzone, /* Number of time zones 1 to 24 */ /* -1 for 24 zones starting with default */ int32_t * offest, /* Time Zone offset (secs) -39600 to +43200 */ int32_t * next, /* number of available TZs */ /* set initially to -1 on first call */ int32_t * max); /* number of available TZs */ /* set initially to -1 on first call */ /* This routine gets time zones appropriate for the current locale. */ U_CAPIX int32_t U_EXPORTX /* new (target) string length or zero*/ xiua_GetNextLocaleTZone(char *target, /* target string */ const int32_t numBytes, /* size of target area */ int32_t * cndx, /* Country index */ /* set initially to -1 on first call */ int32_t * tndx, /* Territory index */ /* set initially to -1 on first call */ int32_t * next, /* number of available TZs */ /* set initially to -1 on first call */ int32_t * max); /* number of available TZs */ /* set initially to -1 on first call */ /* The display time zone routine will build a print line for the specific time zone. The * after the time zone offset indicates that the GMT offset includes a one hour daylight savings time adjustment. A # after the time zone offset indicates that it represents a daylight savings adjustment that is not a hour such as a half hour DST adjustment. */ U_CAPIX int32_t U_EXPORTX /* new (target) string length */ xiua_DisplayTZone(char *target, /* target string */ const int32_t numBytes, /* size of target area */ const char * source); /* Time Zone to display */ U_CAPIX int32_t U_EXPORTX xiu2_DisplayTZone(UChar *target, const int32_t numBytes, const char * source); U_CAPIX int32_t U_EXPORTX xiu4_DisplayTZone(UChar32 *target, const int32_t numBytes, const char * source); U_CAPIX int32_t U_EXPORTX xiu8_DisplayTZone(UChar8 *target, const int32_t numBytes, const char * source); U_CAPIX int32_t U_EXPORTX xicp_DisplayTZone(CpChar *target, const int32_t numBytes, const char * source); /* The maximum character length for the data format and charset */ /* If for example you are using UTF-16 xiua_CharLenMax will return 4 bytes. xiu2_CharLenMax however will return 2 UChar characters. For EUC-HK it will return 4 bytes and for iso-2022-cn it will return 8 bytes.*/ U_CAPIX int32_t U_EXPORTX /* max character length */ xiua_CharLenMax(void); U_CAPIX int32_t U_EXPORTX xiu2_CharLenMax(void); U_CAPIX int32_t U_EXPORTX xiu4_CharLenMax(void); U_CAPIX int32_t U_EXPORTX xiu8_CharLenMax(void); U_CAPIX int32_t U_EXPORTX xicp_CharLenMax(void); /* Returns the minimum character length for the data format and charset */ U_CAPIX int32_t U_EXPORTX /* min character length */ xiua_CharLenMin(void); U_CAPIX int32_t U_EXPORTX xiu2_CharLenMin(void); U_CAPIX int32_t U_EXPORTX xiu4_CharLenMin(void); U_CAPIX int32_t U_EXPORTX xiu8_CharLenMin(void); U_CAPIX int32_t U_EXPORTX xicp_CharLenMin(void); /* The following routines xiua_CharLen through xiua_FixStr that need to know character lengths are currently not implemented for state based code pages such as ISO-2022 */ /* get the length in byte of the character */ U_CAPIX int32_t U_EXPORTX /* character length */ xiua_CharLen(const char * pointer); /* pointer to char in string */ U_CAPIX int32_t U_EXPORTX xiu2_CharLen(const UChar * pointer); U_CAPIX int32_t U_EXPORTX xiu4_CharLen(const UChar32 * pointer); U_CAPIX int32_t U_EXPORTX xiu8_CharLen(const UChar8 * pointer); U_CAPIX int32_t U_EXPORTX xicp_CharLen(const CpChar * pointer); /* Returns the number of characters in the string */ U_CAPIX int32_t U_EXPORTX /* Character Count */ xiua_CharCnt(const char *source, const int32_t limit); U_CAPIX int32_t U_EXPORTX xiu2_CharCnt(const UChar *source, const int32_t limit); U_CAPIX int32_t U_EXPORTX xiu4_CharCnt(const UChar32 *source, const int32_t limit); U_CAPIX int32_t U_EXPORTX xiu8_CharCnt(const UChar8 *source, const int32_t limit); U_CAPIX int32_t U_EXPORTX xicp_CharCnt(const CpChar *source, const int32_t limit); /* returns a pointer to the next character in the string. This is a safe way to increment string pointers to maintain character integrity. It returns a NULL when the end of the string is reached. */ U_CAPIX char * U_EXPORTX /* Next Character */ xiua_CharNext(const char *pointer); /* pointer to current character */ U_CAPIX UChar * U_EXPORTX xiu2_CharNext(const UChar *pointer); U_CAPIX UChar32 * U_EXPORTX xiu4_CharNext(const UChar32 *pointer); U_CAPIX UChar8 * U_EXPORTX xiu8_CharNext(const UChar8 *pointer); U_CAPIX CpChar * U_EXPORTX xicp_CharNext(const CpChar *pointer); /* This returns a pointer to the previous character in the string. It takes a pointer to the beginning of the string. Some code sets require scanning from the start of string. It returns a NULL pointer when the biginning of the string is passed. */ U_CAPIX char * U_EXPORTX /* Previous Character */ xiua_CharPrev(const char *pointer, /* pointer to current character */ const char * source); /* start of string contains both comparison test */ U_CAPIX UChar * U_EXPORTX xiu2_CharPrev(const UChar *pointer, const UChar * source); U_CAPIX UChar32 * U_EXPORTX xiu4_CharPrev(const UChar32 *pointer, const UChar32 * source); U_CAPIX UChar8 * U_EXPORTX xiu8_CharPrev(const UChar8 *pointer, const UChar8 * source); U_CAPIX CpChar * U_EXPORTX xicp_CharPrev(const CpChar *pointer, const CpChar * source); /* Validates that the string conforms to the basic data format and character set enconding rules. It does not verify the the code point is actualy a valid character, just that it is a potential character. If the entire string is valid it returns -1 */ U_CAPIX int32_t U_EXPORTX /* Valid Character Count */ xiua_ValidateStr(const char *source); /* string to validate */ U_CAPIX int32_t U_EXPORTX xiu2_ValidateStr(const UChar *source); U_CAPIX int32_t U_EXPORTX xiu4_ValidateStr(const UChar32 *source); U_CAPIX int32_t U_EXPORTX xiu8_ValidateStr(const UChar8 *source); U_CAPIX int32_t U_EXPORTX xicp_ValidateStr(const CpChar *source); /* Removes partial characters from the end of a string */ U_CAPIX int32_t U_EXPORTX /* Fixed Character Count */ xiua_FixStr(char *source); /* string to fix */ U_CAPIX int32_t U_EXPORTX xiu2_FixStr(UChar *source); U_CAPIX int32_t U_EXPORTX xiu4_FixStr(UChar32 *source); U_CAPIX int32_t U_EXPORTX xiu8_FixStr(UChar8 *source); U_CAPIX int32_t U_EXPORTX xicp_FixStr(CpChar *source); /* Compares string and returns an index to the first place that the strings are unequal. If both string are equal it returns -1. */ U_CAPIX int32_t U_EXPORTX /* -1 = match or index to mismatch */ xiua_MatchStr(const char *str1, /* string 1 */ const char * str2, /* string 2 */ const int32_t limit); /* limit length */ U_CAPIX int32_t U_EXPORTX xiu2_MatchStr(const UChar *str1, const UChar * str2, const int32_t limit); U_CAPIX int32_t U_EXPORTX xiu4_MatchStr(const UChar32 *str1, const UChar32 * str2, const int32_t limit); U_CAPIX int32_t U_EXPORTX xiu8_MatchStr(const UChar8 *str1, const UChar8 * str2, const int32_t limit); U_CAPIX int32_t U_EXPORTX xicp_MatchStr(const CpChar *str1, const CpChar * str2, const int32_t numBytes); /* This routine will convert digits in any script to ASCII digits. It will also convert double wide characters Roman characters to ASCII characters. If a numeric field is entered as double wide characters this routine will not only convert the digits but the numeric punctuation as well. */ U_CAPIX int32_t U_EXPORTX /* change digits to Roman digits and Roman full width to ASCII */ xiua_RomanDigitStr(char *str); /* string to convert */ U_CAPIX int32_t U_EXPORTX xiu2_RomanDigitStr(UChar *str); U_CAPIX int32_t U_EXPORTX xiu4_RomanDigitStr(UChar32 *str); U_CAPIX int32_t U_EXPORTX xiu8_RomanDigitStr(UChar8 *str); U_CAPIX int32_t U_EXPORTX xicp_RomanDigitStr(CpChar *str); /* Special form of collation designed for scripting language where the caller can pass a string to control the collation comparison. It also returns a TRUE/FALSE indication sutable for inclusion in a more complex relational test. */ U_CAPIX int32_t U_EXPORTX /* 1 = TRUE, 0 = FALSE, -1 = LOGIC ERROR */ xiua_Collate(const char *str1, /* string 1 */ const char * option, /* option string contains both comparison test */ /* and optional collation strength parameters */ /* "==" "<=" ">=" "!=" "<" ">" are the */ /* comparison test values and "?" ":" "#" are */ /* the valid strength codes. "==?" is a test */ /* for equal primary strength. */ /* ? = Primary letters match no case or case */ /* e.g "Black-bird" ==? "blackbird" */ /* but what consitiute separate letters may differ */ /* by locale e.g. Spanish ch ll */ /* : = Secondary case insensitive normalized with accents */ /* Tertiary above plus case sensitive (Default)*/ /* # = Strict match */ /* spaces are ignored, non-standard conditions are */ /* supported "!<>" or "=" are the same as "==" */ /* "" or "!" however are illogical and are errors */ const char * str2); /* string 2 */ U_CAPIX int32_t U_EXPORTX xiu2_Collate(const UChar *str1, const char * option, const UChar * str2); U_CAPIX int32_t U_EXPORTX xiu4_Collate(const UChar32 *str1, const char * option, const UChar32 * str2); U_CAPIX int32_t U_EXPORTX xiu8_Collate(const UChar8 *str1, const char * option, const UChar8 * str2); U_CAPIX int32_t U_EXPORTX xicp_Collate(const CpChar *str1, const char * option, const CpChar * str2); /* xiua_strcoll operated like strcoll. xiua_stricoll(xiua_strcasecoll) is a case insensitive collation like Windows stricoll The xiua_strcollEx function allows you to specify collation strength and two choices of normalization. */ /* Primary strength compares letters only without accents or case. This setting also excludes extra spaces and some punctuation. Letters that are explicitly different letters because of the punctuation mark however are compared differently. In traditional Spanish collation "ch" sorts after "cz: because ch is a letter. Because it is a case insensitive search the German sharp-s will match "SS". */ /* Secondary adds accents and punctuation is also enabled. The compare is still case insensitive */ /* Tertiary it the normal default and does a case sensitive collation */ /* Quaternary is an exact match but using collation rules */ /* Normalization standardized that are the same. This a letter followed by a combining accent is the same as the accented letter. The NFKC extend this to make letters that have explicitly different forms the same letter. For example a doublewide letter is made the same as the singlewide form. This allows wider matches but looses information about the explict for of the letter. Standard normalization only affects the internal encoding of the letter but no characteristics of the letter.*/ #define xiua_strcoll(a,b) xiua_strcollEx(a,b,XCOL_TERTIARY) #define xiu2_strcoll(a,b) xiu2_strcollEx(a,b,XCOL_TERTIARY) #define xiu4_strcoll(a,b) xiu4_strcollEx(a,b,XCOL_TERTIARY) #define xiu8_strcoll(a,b) xiu8_strcollEx(a,b,XCOL_TERTIARY) #define xicp_strcoll(a,b) xicp_strcollEx(a,b,XCOL_TERTIARY) #define xiua_stricoll(a,b) xiua_strcollEx(a,b,XCOL_SECONDARY) #define xiu2_stricoll(a,b) xiu2_strcollEx(a,b,XCOL_SECONDARY) #define xiu4_stricoll(a,b) xiu4_strcollEx(a,b,XCOL_SECONDARY) #define xiu8_stricoll(a,b) xiu8_strcollEx(a,b,XCOL_SECONDARY) #define xicp_stricoll(a,b) xicp_strcollEx(a,b,XCOL_SECONDARY) #define xiua_strcasecoll(a,b) xiua_strcollEx(a,b,XCOL_SECONDARY) #define xiu2_strcasecoll(a,b) xiu2_strcollEx(a,b,XCOL_SECONDARY) #define xiu4_strcasecoll(a,b) xiu4_strcollEx(a,b,XCOL_SECONDARY) #define xiu8_strcasecoll(a,b) xiu8_strcollEx(a,b,XCOL_SECONDARY) #define xicp_strcasecoll(a,b) xicp_strcollEx(a,b,XCOL_SECONDARY) U_CAPIX int32_t U_EXPORTX /* 1 = s1>s2, 0 = s1=s1, -1 = s1s2, 0 = s1=s1, -1 = s1s2, 0 = s1=s1, -1 = s1s2, 0 = s1=s1, -1 = s1s2, 0 = s1=s1, -1 = s1s2, 0 = s1=s1, -1 = s1 U+FFFF and \Uxxxxxxxx for any Uncode character. The lower case 'u' indicates that it is followed by 4 hex digits and the upper case 'U' indicates that it is followed by 8 hex digits. */ /* this routine can be used to unescape any string. It is not limited to date formats. */ U_CAPIX int32_t U_EXPORTX /* new (target) string length */ xiua_BuildDateFormat(UChar *target, /* target output area */ const int32_t targetLen, /* size of target area */ const char * source); /* date/time format string */ /* This routine uses the current locale setting to convert strftime date time formats into ICU formats. It uses the date_fmt and time_fmt to determine whether to use short, medium, long or full ICU formats when converting strftime %c, %C, %x and %X values. */ U_CAPIX int32_t U_EXPORTX /* new (target) string length */ xiua_ConvStrftimeFormat(UChar *target, /* target output area */ const int32_t targetLen, /* size of target area */ const XIUA_DateFormat date_fmt, /* date format option */ const XIUA_DateFormat time_fmt, /* time format option */ const char * source); /* strftime string */ /* This routine formats a date. It uses the date_fmt and time_fmt if no date format is provided. The date format is in ICU format and must be a UTF-16 string. Unlike ICU it uses standard epoch time. The number of seconds since 1/1/70.*/ U_CAPIX int32_t U_EXPORTX /* new (target) string length */ xiua_DateFormat(char *target, /* target output area */ const int32_t targetLen, /* size of target area */ const time_t time, /* time in secs since 1/1/70 GMT */ /* or 0 to get current TOD */ const XIUA_DateFormat date_fmt, /* ignored unless format is NULL */ const XIUA_DateFormat time_fmt, const UChar * format); /* date/time format string */ U_CAPIX int32_t U_EXPORTX xiu2_DateFormat(UChar *target, const int32_t targetLen, const time_t time, const XIUA_DateFormat date_fmt, const XIUA_DateFormat time_fmt, const UChar * format); U_CAPIX int32_t U_EXPORTX xiu4_DateFormat(UChar32 *target, const int32_t targetLen, const time_t time, const XIUA_DateFormat date_fmt, const XIUA_DateFormat time_fmt, const UChar * format); U_CAPIX int32_t U_EXPORTX xiu8_DateFormat(UChar8 *target, const int32_t targetLen, const time_t time, const XIUA_DateFormat date_fmt, const XIUA_DateFormat time_fmt, const UChar * format); U_CAPIX int32_t U_EXPORTX xicp_DateFormat(CpChar *target, const int32_t targetLen, const time_t time, const XIUA_DateFormat date_fmt, const XIUA_DateFormat time_fmt, const UChar * format); /* Parses a date/time value. If date_fmt is XDTANY that it will try any supplied format (if any) and then all 4 ICU date formats with the supplied time_fmt. The same applies to when time_fmt is XDTANY. When both are set to XDTANY it tries each possible time format with each date format. If neither is set to XDTANY then it will only try the format or the date_fmt and time_fmt combination if the format pointer is NULL. This routine will return when is sucessfully parses the date time value or exhausts all possibilities. */ U_CAPIX time_t U_EXPORTX /* time in secs since 1/1/70 GMT */ xiua_DateParse(const char *source, /* source area */ const XIUA_DateFormat date_fmt, /* ignored unless format is NULL */ const XIUA_DateFormat time_fmt, const UChar * format); /* date/time format string */ U_CAPIX time_t U_EXPORTX xiu2_DateParse(const UChar *source, const XIUA_DateFormat date_fmt, const XIUA_DateFormat time_fmt, const UChar * format); U_CAPIX time_t U_EXPORTX xiu4_DateParse(const UChar32 *source, const XIUA_DateFormat date_fmt, const XIUA_DateFormat time_fmt, const UChar * format); U_CAPIX time_t U_EXPORTX xiu8_DateParse(const UChar8 *source, const XIUA_DateFormat date_fmt, const XIUA_DateFormat time_fmt, const UChar * format); U_CAPIX time_t U_EXPORTX xicp_DateParse(const CpChar *source, const XIUA_DateFormat date_fmt, const XIUA_DateFormat time_fmt, const UChar * format); /* The following number formating and parsing routines support the following formats: XNFDECIMAL formats as a decimal number XNFCURRENCY formats as currency XNFPERCENT formats as a percentage The XNFANY format is used by the parsing routines to try all three formats until the number parses properly. These routines support signed 32 bit integers and double floating point numbers. */ U_CAPIX int32_t U_EXPORTX /* new (target) string length */ xiua_IntFormat(char *target, /* target output area */ const int32_t targetLen, /* size of target area */ const int32_t source, /* Integer to format */ const XIUA_NumFormat format); /* number format */ U_CAPIX int32_t U_EXPORTX xiu2_IntFormat(UChar *target, const int32_t targetLen, const int32_t source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xiu4_IntFormat(UChar32 *target, const int32_t targetLen, const int32_t source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xiu8_IntFormat(UChar8 *target, const int32_t targetLen, const int32_t source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xicp_IntFormat(CpChar *target, const int32_t targetLen, const int32_t source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX /* new (target) string length */ xiua_FloatFormat(char *target, /* target output area */ const int32_t targetLen, /* size of target area */ const double source, /* Float to format */ const XIUA_NumFormat format); /* number format */ U_CAPIX int32_t U_EXPORTX xiu2_FloatFormat(UChar *target, const int32_t targetLen, const double source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xiu4_FloatFormat(UChar32 *target, const int32_t targetLen, const double source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xiu8_FloatFormat(UChar8 *target, const int32_t targetLen, const double source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xicp_FloatFormat(CpChar *target, const int32_t targetLen, const double source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX /* result */ xiua_IntParse(const char *source, /* source input area */ const XIUA_NumFormat format); /* number format */ U_CAPIX int32_t U_EXPORTX xiu2_IntParse(const UChar *source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xiu4_IntParse(const UChar32 *source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xiu8_IntParse(const UChar8 *source, const XIUA_NumFormat format); U_CAPIX int32_t U_EXPORTX xicp_IntParse(const CpChar *source, const XIUA_NumFormat format); U_CAPIX double U_EXPORTX /* result */ xiua_FloatParse(const char *source, /* source input area */ const XIUA_NumFormat format); /* number format */ U_CAPIX double U_EXPORTX xiu2_FloatParse(const UChar *source, const XIUA_NumFormat format); U_CAPIX double U_EXPORTX xiu4_FloatParse(const UChar32 *source, const XIUA_NumFormat format); U_CAPIX double U_EXPORTX xiu8_FloatParse(const UChar8 *source, const XIUA_NumFormat format); U_CAPIX double U_EXPORTX xicp_FloatParse(const CpChar *source, const XIUA_NumFormat format); /* This routine converts the date from one locale type to another. If the data type is the same the data is just copied. If the locale are both code page locales they must be different locales. xIUA provides multiple codepage date type identifiers for this purpose. They are XDFCODEPAGE, XDFCPWIN, XDFCPUNIX, XDFCPMAC, XDFCPOSA and XDFCPOSB. xIUA handles these types identically but uniquely. For example: LocJP_win = xiua_OpenLocale("ja_JP.Shift_JIS",XDFCPWIN); LocJP_unix = xiua_OpenLocale("ja_JP.EUC-JP",XDFCPUNIX); xiua_LocaletoLocale(target,1024,source,-1,LocJP_unix,LocJP_win); This will convert the string from EUC-JP to Shift_JIS. xiua_LocaletoNative uses the current locale as the target locale. xiua_NativetoLocale uses the current locale as the source locale. */ U_CAPIX int32_t U_EXPORTX /* Number of characters of data in UTF-16 output area */ xiua_LocaletoLocale(char *target, /* output area */ const int32_t targetLen, /* output area length */ const char * source, /* input source data */ const int32_t sourceLen, /* number of bytes to process */ /* set to -1 to convert strings */ const XIUA_Locale * fromLocale, /* locale to convert from */ const XIUA_Locale * toLocale); /* locale to convert to */ U_CAPIX int32_t U_EXPORTX /* Number of characters of data in UTF-16 output area */ xiua_LocaletoNative(char *target, /* output area */ const int32_t targetLen, /* output area length */ const char * source, /* input source data */ const int32_t sourceLen, /* number of bytes to process */ /* set to -1 to convert strings */ const XIUA_Locale * fromLocale); /* locale to convert from */ U_CAPIX int32_t U_EXPORTX /* Number of characters of data in UTF-16 output area */ xiua_NativetoLocale(char *target, /* output area */ const int32_t targetLen, /* output area length */ const char * source, /* input source data */ const int32_t sourceLen, /* number of bytes to process */ /* set to -1 to convert strings */ const XIUA_Locale * toLocale); /* locale to convert to */ /* Explicit conversion routines. Native referes to the data format of the current locale. */ U_CAPIX int32_t U_EXPORTX /* Number of characters of data in UTF-16 output area */ xiua_NativetoUTF16(UChar *target, /* UTF-16 output area */ const int32_t targetLen, /* output area length */ const char * source, /* input source data */ const int32_t sourceLen); /* number of bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of characters of data in UTF-32 output area */ xiua_NativetoUTF32(UChar32 *target, /* UTF-32 output area */ const int32_t targetLen, /* output area length */ const char * source, /* input source data */ const int32_t sourceLen); /* number of bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in UTF-8 output area */ xiua_NativetoUTF8(char *target, /* UTF-8 output area */ const int32_t targetLen, /* output area length */ const char * source, /* input source data */ const int32_t sourceLen); /* number of bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in output area */ xiua_NativetoChar(char *target, /* Code page output area */ const int32_t targetLen, /* output area length */ const char * source, /* input source data */ const int32_t sourceLen); /* number of bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in output area */ xiua_UTF16toNative(char *target, /* Native character output area */ const int32_t targetLen, /* output area length */ const UChar * source, /* UTF-16 input source data */ const int32_t sourceLen); /* number of UTF-16 characters to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of characters of data in UTF-32 output area */ xiua_UTF16toUTF32(UChar32 *target, /* UTF-32 output area */ const int32_t targetLen, /* output area length */ const UChar * source, /* UTF-16 input source data */ const int32_t sourceLen); /* number of UTF-16 characters to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in UTF-8 output area */ xiua_UTF16toUTF8(char *target, /* UTF-8 output area */ const int32_t targetLen, /* output area length */ const UChar * source, /* UTF-16 input source data */ const int32_t sourceLen); /* number of UTF-16 characters to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in Char output area */ xiua_UTF16toChar(char *target, /* Char output area */ const int32_t targetLen, /* output area length */ const UChar * source, /* UTF-16 input source data */ const int32_t sourceLen); /* number of UTF-16 characters to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in output area */ xiua_UTF32toNative(char *target, /* Native character output area */ const int32_t targetLen, /* output area length */ const UChar32 * source, /* UTF-32 input source data */ const int32_t sourceLen); /* number of UTF-32 characters to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of characters of data in UTF-16 output area */ xiua_UTF32toUTF16(UChar *target, /* UTF-16 output area */ const int32_t targetLen, /* output area length */ const UChar32 * source, /* UTF-32 input source data */ const int32_t sourceLen); /* number of UTF-32 characters to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in UTF-8 output area */ xiua_UTF32toUTF8(char *target, /* UTF-8 output area */ const int32_t targetLen, /* output area length */ const UChar32 * source, /* UTF-32 input source data */ const int32_t sourceLen); /* number of UTF-32 characters to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in Char output area */ xiua_UTF32toChar(char *target, /* Char output area */ const int32_t targetLen, /* output area length */ const UChar32 * source, /* UTF-32 input source data */ const int32_t sourceLen); /* number of UTF-32 characters to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in output area */ xiua_UTF8toNative(char *target, /* Native character output area */ const int32_t targetLen, /* output area length */ const char * source, /* UTF-8 input source data */ const int32_t sourceLen); /* number of UTF-8 bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of UTF-16 characters in output area*/ xiua_UTF8toUTF16(UChar *target, /* UTF-16 output area */ const int32_t targetLen, /* output area length */ const char * source, /* UTF-8 input source data */ const int32_t sourceLen); /* number of UTF-8 bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of UTF-16 characters in output area*/ xiua_UTF8toUTF16Ex(UChar *target, /* UTF-16 output area */ const int32_t targetLen, /* output area length */ const char * source, /* UTF-8 input source data */ const int32_t numChars, /* number of UTF-8 characters to process */ const int32_t numBytes); /* number of UTF-8 bytes to process */ /* set both to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of UTF-32 characters in output area*/ xiua_UTF8toUTF32(UChar32 *target, /* UTF-32 output area */ const int32_t targetLen, /* output area length */ const char * source, /* UTF-8 input source data */ const int32_t sourceLen); /* number of UTF-8 bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of UTF-32 characters in output area*/ xiua_UTF8toUTF32Ex(UChar32 *target, /* UTF-32 output area */ const int32_t targetLen, /* output area length */ const char * source, /* UTF-8 input source data */ const int32_t numChars, /* number of UTF-8 characters to process */ const int32_t numBytes); /* number of UTF-8 bytes to process */ /* set both to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in Char output area */ xiua_UTF8toChar(char *target, /* Char output area */ const int32_t targetLen, /* output area length */ const char * source, /* UTF-8 input source data */ const int32_t sourceLen); /* number of UTF-8 bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in Char output area */ xiua_UTF8toCharEx(char *target, /* Char output area */ const int32_t targetLen, /* output area length */ const char * source, /* UTF-8 input source data */ const int32_t numChars, /* number of UTF-8 characters to process */ const int32_t numBytes); /* number of UTF-8 bytes to process */ /* set both to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of bytes of data in output area */ xiua_ChartoNative(char *target, /* Native character output area */ const int32_t targetLen, /* output area length */ const char * source, /* Code page input source data */ const int32_t sourceLen); /* number of Code page bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of UTF-16 characters in output area*/ xiua_ChartoUTF16(UChar *target, /* UTF-16 output area */ const int32_t targetLen, /* output area length */ const char * source, /* Char input source data */ const int32_t sourceLen); /* number of Char bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of UTF-32 characters in output area*/ xiua_ChartoUTF32(UChar32 *target, /* UTF-32 output area */ const int32_t targetLen, /* output area length */ const char * source, /* Char input source data */ const int32_t sourceLen); /* number of Char bytes to process */ /* set to -1 to convert strings */ U_CAPIX int32_t U_EXPORTX /* Number of UTF-8 characters in output area*/ xiua_ChartoUTF8(char *target, /* UTF-8 output area */ const int32_t targetLen, /* output area length */ const char * source, /* Char input source data */ const int32_t sourceLen); /* number of Char bytes to process */ /* set to -1 to convert strings */ #endif /*_XIUA*/