2 *******************************************************************************
3 * Copyright (c) 1996-2012, International Business Machines Corporation and others.
5 *******************************************************************************
11 #include "unicode/utypes.h"
13 #if !UCONFIG_NO_COLLATION
15 #include "unicode/unorm.h"
16 #include "unicode/localpointer.h"
17 #include "unicode/parseerr.h"
18 #include "unicode/uloc.h"
19 #include "unicode/uset.h"
20 #include "unicode/uscript.h"
24 * \brief C API: Collator
26 * <h2> Collator C API </h2>
28 * The C API for Collator performs locale-sensitive
29 * string comparison. You use this service to build
30 * searching and sorting routines for natural language text.
31 * <em>Important: </em>The ICU collation service has been reimplemented
32 * in order to achieve better performance and UCA compliance.
33 * For details, see the
34 * <a href="http://source.icu-project.org/repos/icu/icuhtml/trunk/design/collation/ICU_collation_design.htm">
35 * collation design document</a>.
37 * For more information about the collation service see
38 * <a href="http://icu-project.org/userguide/Collate_Intro.html">the users guide</a>.
40 * Collation service provides correct sorting orders for most locales supported in ICU.
41 * If specific data for a locale is not available, the orders eventually falls back
42 * to the <a href="http://www.unicode.org/unicode/reports/tr10/">UCA sort order</a>.
44 * Sort ordering may be customized by providing your own set of rules. For more on
45 * this subject see the
46 * <a href="http://icu-project.org/userguide/Collate_Customization.html">
47 * Collation customization</a> section of the users guide.
49 * @see UCollationResult
50 * @see UNormalizationMode
51 * @see UCollationStrength
52 * @see UCollationElements
56 * For usage in C programs.
59 /** structure representing a collator object instance
62 typedef struct UCollator UCollator
;
66 * UCOL_LESS is returned if source string is compared to be less than target
67 * string in the u_strcoll() method.
68 * UCOL_EQUAL is returned if source string is compared to be equal to target
69 * string in the u_strcoll() method.
70 * UCOL_GREATER is returned if source string is compared to be greater than
71 * target string in the u_strcoll() method.
74 * Possible values for a comparison result
78 /** string a == string b */
80 /** string a > string b */
82 /** string a < string b */
87 /** Enum containing attribute values for controling collation behavior.
88 * Here are all the allowable values. Not every attribute can take every value. The only
89 * universal value is UCOL_DEFAULT, which resets the attribute value to the predefined
90 * value for that locale
94 /** accepted by most attributes */
97 /** Primary collation strength */
99 /** Secondary collation strength */
101 /** Tertiary collation strength */
103 /** Default collation strength */
104 UCOL_DEFAULT_STRENGTH
= UCOL_TERTIARY
,
105 UCOL_CE_STRENGTH_LIMIT
,
106 /** Quaternary collation strength */
108 /** Identical collation strength */
112 /** Turn the feature off - works for UCOL_FRENCH_COLLATION,
113 UCOL_CASE_LEVEL, UCOL_HIRAGANA_QUATERNARY_MODE
114 & UCOL_DECOMPOSITION_MODE*/
116 /** Turn the feature on - works for UCOL_FRENCH_COLLATION,
117 UCOL_CASE_LEVEL, UCOL_HIRAGANA_QUATERNARY_MODE
118 & UCOL_DECOMPOSITION_MODE*/
121 /** Valid for UCOL_ALTERNATE_HANDLING. Alternate handling will be shifted */
123 /** Valid for UCOL_ALTERNATE_HANDLING. Alternate handling will be non ignorable */
124 UCOL_NON_IGNORABLE
= 21,
126 /** Valid for UCOL_CASE_FIRST -
127 lower case sorts before upper case */
128 UCOL_LOWER_FIRST
= 24,
129 /** upper case sorts before lower case */
130 UCOL_UPPER_FIRST
= 25,
132 UCOL_ATTRIBUTE_VALUE_COUNT
134 } UColAttributeValue
;
137 * Enum containing the codes for reordering segments of the collation table that are not script
138 * codes. These reordering codes are to be used in conjunction with the script codes.
139 * @see ucol_getReorderCodes
140 * @see ucol_setReorderCodes
141 * @see ucol_getEquivalentReorderCodes
147 * A special reordering code that is used to specify the default
148 * reordering codes for a locale.
151 UCOL_REORDER_CODE_DEFAULT
= -1,
153 * A special reordering code that is used to specify no reordering codes.
156 UCOL_REORDER_CODE_NONE
= USCRIPT_UNKNOWN
,
158 * A special reordering code that is used to specify all other codes used for
159 * reordering except for the codes lised as UColReorderCode values and those
160 * listed explicitly in a reordering.
163 UCOL_REORDER_CODE_OTHERS
= USCRIPT_UNKNOWN
,
165 * Characters with the space property.
166 * This is equivalent to the rule value "space".
169 UCOL_REORDER_CODE_SPACE
= 0x1000,
171 * The first entry in the enumeration of reordering groups. This is intended for use in
172 * range checking and enumeration of the reorder codes.
175 UCOL_REORDER_CODE_FIRST
= UCOL_REORDER_CODE_SPACE
,
177 * Characters with the punctuation property.
178 * This is equivalent to the rule value "punct".
181 UCOL_REORDER_CODE_PUNCTUATION
= 0x1001,
183 * Characters with the symbol property.
184 * This is equivalent to the rule value "symbol".
187 UCOL_REORDER_CODE_SYMBOL
= 0x1002,
189 * Characters with the currency property.
190 * This is equivalent to the rule value "currency".
193 UCOL_REORDER_CODE_CURRENCY
= 0x1003,
195 * Characters with the digit property.
196 * This is equivalent to the rule value "digit".
199 UCOL_REORDER_CODE_DIGIT
= 0x1004,
201 * The limit of the reorder codes. This is intended for use in range checking
202 * and enumeration of the reorder codes.
205 UCOL_REORDER_CODE_LIMIT
= 0x1005
209 * Base letter represents a primary difference. Set comparison
210 * level to UCOL_PRIMARY to ignore secondary and tertiary differences.
211 * Use this to set the strength of a Collator object.
212 * Example of primary difference, "abc" < "abd"
214 * Diacritical differences on the same base letter represent a secondary
215 * difference. Set comparison level to UCOL_SECONDARY to ignore tertiary
216 * differences. Use this to set the strength of a Collator object.
217 * Example of secondary difference, "ä" >> "a".
219 * Uppercase and lowercase versions of the same character represents a
220 * tertiary difference. Set comparison level to UCOL_TERTIARY to include
221 * all comparison differences. Use this to set the strength of a Collator
223 * Example of tertiary difference, "abc" <<< "ABC".
225 * Two characters are considered "identical" when they have the same
226 * unicode spellings. UCOL_IDENTICAL.
227 * For example, "ä" == "ä".
229 * UCollationStrength is also used to determine the strength of sort keys
230 * generated from UCollator objects
231 * These values can be now found in the UColAttributeValue enum.
234 typedef UColAttributeValue UCollationStrength
;
236 /** Attributes that collation service understands. All the attributes can take UCOL_DEFAULT
237 * value, as well as the values specific to each one.
241 /** Attribute for direction of secondary weights - used in French.
242 * Acceptable values are UCOL_ON, which results in secondary weights
243 * being considered backwards and UCOL_OFF which treats secondary
244 * weights in the order they appear.*/
245 UCOL_FRENCH_COLLATION
,
246 /** Attribute for handling variable elements.
247 * Acceptable values are UCOL_NON_IGNORABLE (default)
248 * which treats all the codepoints with non-ignorable
249 * primary weights in the same way,
250 * and UCOL_SHIFTED which causes codepoints with primary
251 * weights that are equal or below the variable top value
252 * to be ignored on primary level and moved to the quaternary
254 UCOL_ALTERNATE_HANDLING
,
255 /** Controls the ordering of upper and lower case letters.
256 * Acceptable values are UCOL_OFF (default), which orders
257 * upper and lower case letters in accordance to their tertiary
258 * weights, UCOL_UPPER_FIRST which forces upper case letters to
259 * sort before lower case letters, and UCOL_LOWER_FIRST which does
262 /** Controls whether an extra case level (positioned before the third
263 * level) is generated or not. Acceptable values are UCOL_OFF (default),
264 * when case level is not generated, and UCOL_ON which causes the case
265 * level to be generated. Contents of the case level are affected by
266 * the value of UCOL_CASE_FIRST attribute. A simple way to ignore
267 * accent differences in a string is to set the strength to UCOL_PRIMARY
268 * and enable case level. */
270 /** Controls whether the normalization check and necessary normalizations
271 * are performed. When set to UCOL_OFF (default) no normalization check
272 * is performed. The correctness of the result is guaranteed only if the
273 * input data is in so-called FCD form (see users manual for more info).
274 * When set to UCOL_ON, an incremental check is performed to see whether
275 * the input data is in the FCD form. If the data is not in the FCD form,
276 * incremental NFD normalization is performed. */
277 UCOL_NORMALIZATION_MODE
,
278 /** An alias for UCOL_NORMALIZATION_MODE attribute */
279 UCOL_DECOMPOSITION_MODE
= UCOL_NORMALIZATION_MODE
,
280 /** The strength attribute. Can be either UCOL_PRIMARY, UCOL_SECONDARY,
281 * UCOL_TERTIARY, UCOL_QUATERNARY or UCOL_IDENTICAL. The usual strength
282 * for most locales (except Japanese) is tertiary. Quaternary strength
283 * is useful when combined with shifted setting for alternate handling
284 * attribute and for JIS x 4061 collation, when it is used to distinguish
285 * between Katakana and Hiragana (this is achieved by setting the
286 * UCOL_HIRAGANA_QUATERNARY mode to on. Otherwise, quaternary level
287 * is affected only by the number of non ignorable code points in
288 * the string. Identical strength is rarely useful, as it amounts
289 * to codepoints of the NFD form of the string. */
291 /** When turned on, this attribute positions Hiragana before all
292 * non-ignorables on quaternary level This is a sneaky way to produce JIS
294 UCOL_HIRAGANA_QUATERNARY_MODE
,
295 /** When turned on, this attribute generates a collation key
296 * for the numeric value of substrings of digits.
297 * This is a way to get '100' to sort AFTER '2'. Note that the longest
298 * digit substring that can be treated as a single collation element is
299 * 254 digits (not counting leading zeros). If a digit substring is
300 * longer than that, the digits beyond the limit will be treated as a
301 * separate digit substring associated with a separate collation element. */
302 UCOL_NUMERIC_COLLATION
,
306 /** Options for retrieving the rule string
310 /** Retrieve tailoring only */
312 /** Retrieve UCA rules and tailoring */
317 * Open a UCollator for comparing strings.
318 * The UCollator pointer is used in all the calls to the Collation
319 * service. After finished, collator must be disposed of by calling
320 * {@link #ucol_close }.
321 * @param loc The locale containing the required collation rules.
322 * Special values for locales can be passed in -
323 * if NULL is passed for the locale, the default locale
324 * collation rules will be used. If empty string ("") or
325 * "root" are passed, UCA rules will be used.
326 * @param status A pointer to an UErrorCode to receive any errors
327 * @return A pointer to a UCollator, or 0 if an error occurred.
328 * @see ucol_openRules
329 * @see ucol_safeClone
333 U_STABLE UCollator
* U_EXPORT2
334 ucol_open(const char *loc
, UErrorCode
*status
);
337 * Produce an UCollator instance according to the rules supplied.
338 * The rules are used to change the default ordering, defined in the
339 * UCA in a process called tailoring. The resulting UCollator pointer
340 * can be used in the same way as the one obtained by {@link #ucol_strcoll }.
341 * @param rules A string describing the collation rules. For the syntax
342 * of the rules please see users guide.
343 * @param rulesLength The length of rules, or -1 if null-terminated.
344 * @param normalizationMode The normalization mode: One of
345 * UCOL_OFF (expect the text to not need normalization),
346 * UCOL_ON (normalize), or
347 * UCOL_DEFAULT (set the mode according to the rules)
348 * @param strength The default collation strength; one of UCOL_PRIMARY, UCOL_SECONDARY,
349 * UCOL_TERTIARY, UCOL_IDENTICAL,UCOL_DEFAULT_STRENGTH - can be also set in the rules.
350 * @param parseError A pointer to UParseError to recieve information about errors
351 * occurred during parsing. This argument can currently be set
352 * to NULL, but at users own risk. Please provide a real structure.
353 * @param status A pointer to an UErrorCode to receive any errors
354 * @return A pointer to a UCollator. It is not guaranteed that NULL be returned in case
355 * of error - please use status argument to check for errors.
357 * @see ucol_safeClone
361 U_STABLE UCollator
* U_EXPORT2
362 ucol_openRules( const UChar
*rules
,
364 UColAttributeValue normalizationMode
,
365 UCollationStrength strength
,
366 UParseError
*parseError
,
370 * Open a collator defined by a short form string.
371 * The structure and the syntax of the string is defined in the "Naming collators"
372 * section of the users guide:
373 * http://icu-project.org/userguide/Collate_Concepts.html#Naming_Collators
374 * Attributes are overriden by the subsequent attributes. So, for "S2_S3", final
375 * strength will be 3. 3066bis locale overrides individual locale parts.
376 * The call to this function is equivalent to a call to ucol_open, followed by a
377 * series of calls to ucol_setAttribute and ucol_setVariableTop.
378 * @param definition A short string containing a locale and a set of attributes.
379 * Attributes not explicitly mentioned are left at the default
380 * state for a locale.
381 * @param parseError if not NULL, structure that will get filled with error's pre
382 * and post context in case of error.
383 * @param forceDefaults if FALSE, the settings that are the same as the collator
384 * default settings will not be applied (for example, setting
385 * French secondary on a French collator would not be executed).
386 * If TRUE, all the settings will be applied regardless of the
387 * collator default value. If the definition
388 * strings are to be cached, should be set to FALSE.
389 * @param status Error code. Apart from regular error conditions connected to
390 * instantiating collators (like out of memory or similar), this
391 * API will return an error if an invalid attribute or attribute/value
392 * combination is specified.
393 * @return A pointer to a UCollator or 0 if an error occured (including an
394 * invalid attribute).
396 * @see ucol_setAttribute
397 * @see ucol_setVariableTop
398 * @see ucol_getShortDefinitionString
399 * @see ucol_normalizeShortDefinitionString
403 U_STABLE UCollator
* U_EXPORT2
404 ucol_openFromShortString( const char *definition
,
406 UParseError
*parseError
,
409 #ifndef U_HIDE_DEPRECATED_API
411 * Get a set containing the contractions defined by the collator. The set includes
412 * both the UCA contractions and the contractions defined by the collator. This set
413 * will contain only strings. If a tailoring explicitly suppresses contractions from
414 * the UCA (like Russian), removed contractions will not be in the resulting set.
415 * @param coll collator
416 * @param conts the set to hold the result. It gets emptied before
417 * contractions are added.
418 * @param status to hold the error code
419 * @return the size of the contraction set
421 * @deprecated ICU 3.4, use ucol_getContractionsAndExpansions instead
423 U_DEPRECATED
int32_t U_EXPORT2
424 ucol_getContractions( const UCollator
*coll
,
427 #endif /* U_HIDE_DEPRECATED_API */
430 * Get a set containing the expansions defined by the collator. The set includes
431 * both the UCA expansions and the expansions defined by the tailoring
432 * @param coll collator
433 * @param contractions if not NULL, the set to hold the contractions
434 * @param expansions if not NULL, the set to hold the expansions
435 * @param addPrefixes add the prefix contextual elements to contractions
436 * @param status to hold the error code
440 U_STABLE
void U_EXPORT2
441 ucol_getContractionsAndExpansions( const UCollator
*coll
,
442 USet
*contractions
, USet
*expansions
,
443 UBool addPrefixes
, UErrorCode
*status
);
447 * Once closed, a UCollator should not be used. Every open collator should
448 * be closed. Otherwise, a memory leak will result.
449 * @param coll The UCollator to close.
451 * @see ucol_openRules
452 * @see ucol_safeClone
455 U_STABLE
void U_EXPORT2
456 ucol_close(UCollator
*coll
);
458 #if U_SHOW_CPLUSPLUS_API
463 * \class LocalUCollatorPointer
464 * "Smart pointer" class, closes a UCollator via ucol_close().
465 * For most methods see the LocalPointerBase base class.
467 * @see LocalPointerBase
471 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCollatorPointer
, UCollator
, ucol_close
);
478 * Compare two strings.
479 * The strings will be compared using the options already specified.
480 * @param coll The UCollator containing the comparison rules.
481 * @param source The source string.
482 * @param sourceLength The length of source, or -1 if null-terminated.
483 * @param target The target string.
484 * @param targetLength The length of target, or -1 if null-terminated.
485 * @return The result of comparing the strings; one of UCOL_EQUAL,
486 * UCOL_GREATER, UCOL_LESS
488 * @see ucol_greaterOrEqual
492 U_STABLE UCollationResult U_EXPORT2
493 ucol_strcoll( const UCollator
*coll
,
495 int32_t sourceLength
,
497 int32_t targetLength
);
500 * Determine if one string is greater than another.
501 * This function is equivalent to {@link #ucol_strcoll } == UCOL_GREATER
502 * @param coll The UCollator containing the comparison rules.
503 * @param source The source string.
504 * @param sourceLength The length of source, or -1 if null-terminated.
505 * @param target The target string.
506 * @param targetLength The length of target, or -1 if null-terminated.
507 * @return TRUE if source is greater than target, FALSE otherwise.
509 * @see ucol_greaterOrEqual
513 U_STABLE UBool U_EXPORT2
514 ucol_greater(const UCollator
*coll
,
515 const UChar
*source
, int32_t sourceLength
,
516 const UChar
*target
, int32_t targetLength
);
519 * Determine if one string is greater than or equal to another.
520 * This function is equivalent to {@link #ucol_strcoll } != UCOL_LESS
521 * @param coll The UCollator containing the comparison rules.
522 * @param source The source string.
523 * @param sourceLength The length of source, or -1 if null-terminated.
524 * @param target The target string.
525 * @param targetLength The length of target, or -1 if null-terminated.
526 * @return TRUE if source is greater than or equal to target, FALSE otherwise.
532 U_STABLE UBool U_EXPORT2
533 ucol_greaterOrEqual(const UCollator
*coll
,
534 const UChar
*source
, int32_t sourceLength
,
535 const UChar
*target
, int32_t targetLength
);
538 * Compare two strings for equality.
539 * This function is equivalent to {@link #ucol_strcoll } == UCOL_EQUAL
540 * @param coll The UCollator containing the comparison rules.
541 * @param source The source string.
542 * @param sourceLength The length of source, or -1 if null-terminated.
543 * @param target The target string.
544 * @param targetLength The length of target, or -1 if null-terminated.
545 * @return TRUE if source is equal to target, FALSE otherwise
548 * @see ucol_greaterOrEqual
551 U_STABLE UBool U_EXPORT2
552 ucol_equal(const UCollator
*coll
,
553 const UChar
*source
, int32_t sourceLength
,
554 const UChar
*target
, int32_t targetLength
);
557 * Compare two UTF-8 encoded trings.
558 * The strings will be compared using the options already specified.
559 * @param coll The UCollator containing the comparison rules.
560 * @param sIter The source string iterator.
561 * @param tIter The target string iterator.
562 * @return The result of comparing the strings; one of UCOL_EQUAL,
563 * UCOL_GREATER, UCOL_LESS
564 * @param status A pointer to an UErrorCode to receive any errors
568 U_STABLE UCollationResult U_EXPORT2
569 ucol_strcollIter( const UCollator
*coll
,
570 UCharIterator
*sIter
,
571 UCharIterator
*tIter
,
575 * Get the collation strength used in a UCollator.
576 * The strength influences how strings are compared.
577 * @param coll The UCollator to query.
578 * @return The collation strength; one of UCOL_PRIMARY, UCOL_SECONDARY,
579 * UCOL_TERTIARY, UCOL_QUATERNARY, UCOL_IDENTICAL
580 * @see ucol_setStrength
583 U_STABLE UCollationStrength U_EXPORT2
584 ucol_getStrength(const UCollator
*coll
);
587 * Set the collation strength used in a UCollator.
588 * The strength influences how strings are compared.
589 * @param coll The UCollator to set.
590 * @param strength The desired collation strength; one of UCOL_PRIMARY,
591 * UCOL_SECONDARY, UCOL_TERTIARY, UCOL_QUATERNARY, UCOL_IDENTICAL, UCOL_DEFAULT
592 * @see ucol_getStrength
595 U_STABLE
void U_EXPORT2
596 ucol_setStrength(UCollator
*coll
,
597 UCollationStrength strength
);
600 * Retrieves the reordering codes for this collator.
601 * These reordering codes are a combination of UScript codes and UColReorderCode entries.
602 * @param coll The UCollator to query.
603 * @param dest The array to fill with the script ordering.
604 * @param destCapacity The length of dest. If it is 0, then dest may be NULL and the function
605 * will only return the length of the result without writing any of the result string (pre-flighting).
606 * @param pErrorCode Must be a valid pointer to an error code value, which must not indicate a
607 * failure before the function call.
608 * @return The number of reordering codes written to the dest array.
609 * @see ucol_setReorderCodes
610 * @see ucol_getEquivalentReorderCodes
612 * @see UColReorderCode
615 U_DRAFT
int32_t U_EXPORT2
616 ucol_getReorderCodes(const UCollator
* coll
,
618 int32_t destCapacity
,
619 UErrorCode
*pErrorCode
);
621 * Sets the reordering codes for this collator.
622 * Collation reordering allows scripts and some other defined blocks of characters
623 * to be moved relative to each other as a block. This reordering is done on top of
624 * the DUCET/CLDR standard collation order. Reordering can specify groups to be placed
625 * at the start and/or the end of the collation order. These groups are specified using
626 * UScript codes and UColReorderCode entries.
627 * <p>By default, reordering codes specified for the start of the order are placed in the
628 * order given after a group of "special" non-script blocks. These special groups of characters
629 * are space, punctuation, symbol, currency, and digit. These special groups are represented with
630 * UColReorderCode entries. Script groups can be intermingled with
631 * these special non-script blocks if those special blocks are explicitly specified in the reordering.
632 * <p>The special code OTHERS stands for any script that is not explicitly
633 * mentioned in the list of reordering codes given. Anything that is after OTHERS
634 * will go at the very end of the reordering in the order given.
635 * <p>The special reorder code DEFAULT will reset the reordering for this collator
636 * to the default for this collator. The default reordering may be the DUCET/CLDR order or may be a reordering that
637 * was specified when this collator was created from resource data or from rules. The
638 * DEFAULT code <b>must</b> be the sole code supplied when it used. If not
639 * that will result in an U_ILLEGAL_ARGUMENT_ERROR being set.
640 * <p>The special reorder code NONE will remove any reordering for this collator.
641 * The result of setting no reordering will be to have the DUCET/CLDR ordering used. The
642 * NONE code <b>must</b> be the sole code supplied when it used.
643 * @param coll The UCollator to set.
644 * @param reorderCodes An array of script codes in the new order. This can be NULL if the
645 * length is also set to 0. An empty array will clear any reordering codes on the collator.
646 * @param reorderCodesLength The length of reorderCodes.
647 * @param pErrorCode Must be a valid pointer to an error code value, which must not indicate a
648 * failure before the function call.
649 * @see ucol_getReorderCodes
650 * @see ucol_getEquivalentReorderCodes
652 * @see UColReorderCode
655 U_DRAFT
void U_EXPORT2
656 ucol_setReorderCodes(UCollator
* coll
,
657 const int32_t* reorderCodes
,
658 int32_t reorderCodesLength
,
659 UErrorCode
*pErrorCode
);
662 * Retrieves the reorder codes that are grouped with the given reorder code. Some reorder
663 * codes will be grouped and must reorder together.
664 * @param reorderCode The reorder code to determine equivalence for.
665 * @param dest The array to fill with the script ordering.
666 * @param destCapacity The length of dest. If it is 0, then dest may be NULL and the function
667 * will only return the length of the result without writing any of the result string (pre-flighting).
668 * @param pErrorCode Must be a valid pointer to an error code value, which must not indicate
669 * a failure before the function call.
670 * @return The number of reordering codes written to the dest array.
671 * @see ucol_setReorderCodes
672 * @see ucol_getReorderCodes
674 * @see UColReorderCode
677 U_DRAFT
int32_t U_EXPORT2
678 ucol_getEquivalentReorderCodes(int32_t reorderCode
,
680 int32_t destCapacity
,
681 UErrorCode
*pErrorCode
);
684 * Get the display name for a UCollator.
685 * The display name is suitable for presentation to a user.
686 * @param objLoc The locale of the collator in question.
687 * @param dispLoc The locale for display.
688 * @param result A pointer to a buffer to receive the attribute.
689 * @param resultLength The maximum size of result.
690 * @param status A pointer to an UErrorCode to receive any errors
691 * @return The total buffer size needed; if greater than resultLength,
692 * the output was truncated.
695 U_STABLE
int32_t U_EXPORT2
696 ucol_getDisplayName( const char *objLoc
,
699 int32_t resultLength
,
703 * Get a locale for which collation rules are available.
704 * A UCollator in a locale returned by this function will perform the correct
705 * collation for the locale.
706 * @param localeIndex The index of the desired locale.
707 * @return A locale for which collation rules are available, or 0 if none.
708 * @see ucol_countAvailable
711 U_STABLE
const char* U_EXPORT2
712 ucol_getAvailable(int32_t localeIndex
);
715 * Determine how many locales have collation rules available.
716 * This function is most useful as determining the loop ending condition for
717 * calls to {@link #ucol_getAvailable }.
718 * @return The number of locales for which collation rules are available.
719 * @see ucol_getAvailable
722 U_STABLE
int32_t U_EXPORT2
723 ucol_countAvailable(void);
725 #if !UCONFIG_NO_SERVICE
727 * Create a string enumerator of all locales for which a valid
728 * collator may be opened.
729 * @param status input-output error code
730 * @return a string enumeration over locale strings. The caller is
731 * responsible for closing the result.
734 U_STABLE UEnumeration
* U_EXPORT2
735 ucol_openAvailableLocales(UErrorCode
*status
);
739 * Create a string enumerator of all possible keywords that are relevant to
740 * collation. At this point, the only recognized keyword for this
741 * service is "collation".
742 * @param status input-output error code
743 * @return a string enumeration over locale strings. The caller is
744 * responsible for closing the result.
747 U_STABLE UEnumeration
* U_EXPORT2
748 ucol_getKeywords(UErrorCode
*status
);
751 * Given a keyword, create a string enumeration of all values
752 * for that keyword that are currently in use.
753 * @param keyword a particular keyword as enumerated by
754 * ucol_getKeywords. If any other keyword is passed in, *status is set
755 * to U_ILLEGAL_ARGUMENT_ERROR.
756 * @param status input-output error code
757 * @return a string enumeration over collation keyword values, or NULL
758 * upon error. The caller is responsible for closing the result.
761 U_STABLE UEnumeration
* U_EXPORT2
762 ucol_getKeywordValues(const char *keyword
, UErrorCode
*status
);
765 * Given a key and a locale, returns an array of string values in a preferred
766 * order that would make a difference. These are all and only those values where
767 * the open (creation) of the service with the locale formed from the input locale
768 * plus input keyword and that value has different behavior than creation with the
769 * input locale alone.
770 * @param key one of the keys supported by this service. For now, only
771 * "collation" is supported.
772 * @param locale the locale
773 * @param commonlyUsed if set to true it will return only commonly used values
774 * with the given locale in preferred order. Otherwise,
775 * it will return all the available values for the locale.
776 * @param status error status
777 * @return a string enumeration over keyword values for the given key and the locale.
780 U_STABLE UEnumeration
* U_EXPORT2
781 ucol_getKeywordValuesForLocale(const char* key
,
787 * Return the functionally equivalent locale for the given
788 * requested locale, with respect to given keyword, for the
789 * collation service. If two locales return the same result, then
790 * collators instantiated for these locales will behave
791 * equivalently. The converse is not always true; two collators
792 * may in fact be equivalent, but return different results, due to
793 * internal details. The return result has no other meaning than
794 * that stated above, and implies nothing as to the relationship
795 * between the two locales. This is intended for use by
796 * applications who wish to cache collators, or otherwise reuse
797 * collators when possible. The functional equivalent may change
798 * over time. For more information, please see the <a
799 * href="http://icu-project.org/userguide/locale.html#services">
800 * Locales and Services</a> section of the ICU User Guide.
801 * @param result fillin for the functionally equivalent locale
802 * @param resultCapacity capacity of the fillin buffer
803 * @param keyword a particular keyword as enumerated by
805 * @param locale the requested locale
806 * @param isAvailable if non-NULL, pointer to a fillin parameter that
807 * indicates whether the requested locale was 'available' to the
808 * collation service. A locale is defined as 'available' if it
809 * physically exists within the collation locale data.
810 * @param status pointer to input-output error code
811 * @return the actual buffer size needed for the locale. If greater
812 * than resultCapacity, the returned full name will be truncated and
813 * an error code will be returned.
816 U_STABLE
int32_t U_EXPORT2
817 ucol_getFunctionalEquivalent(char* result
, int32_t resultCapacity
,
818 const char* keyword
, const char* locale
,
819 UBool
* isAvailable
, UErrorCode
* status
);
822 * Get the collation rules from a UCollator.
823 * The rules will follow the rule syntax.
824 * @param coll The UCollator to query.
826 * @return The collation rules.
829 U_STABLE
const UChar
* U_EXPORT2
830 ucol_getRules( const UCollator
*coll
,
833 /** Get the short definition string for a collator. This API harvests the collator's
834 * locale and the attribute set and produces a string that can be used for opening
835 * a collator with the same properties using the ucol_openFromShortString API.
836 * This string will be normalized.
837 * The structure and the syntax of the string is defined in the "Naming collators"
838 * section of the users guide:
839 * http://icu-project.org/userguide/Collate_Concepts.html#Naming_Collators
840 * This API supports preflighting.
841 * @param coll a collator
842 * @param locale a locale that will appear as a collators locale in the resulting
843 * short string definition. If NULL, the locale will be harvested
845 * @param buffer space to hold the resulting string
846 * @param capacity capacity of the buffer
847 * @param status for returning errors. All the preflighting errors are featured
848 * @return length of the resulting string
849 * @see ucol_openFromShortString
850 * @see ucol_normalizeShortDefinitionString
853 U_STABLE
int32_t U_EXPORT2
854 ucol_getShortDefinitionString(const UCollator
*coll
,
860 /** Verifies and normalizes short definition string.
861 * Normalized short definition string has all the option sorted by the argument name,
862 * so that equivalent definition strings are the same.
863 * This API supports preflighting.
864 * @param source definition string
865 * @param destination space to hold the resulting string
866 * @param capacity capacity of the buffer
867 * @param parseError if not NULL, structure that will get filled with error's pre
868 * and post context in case of error.
869 * @param status Error code. This API will return an error if an invalid attribute
870 * or attribute/value combination is specified. All the preflighting
871 * errors are also featured
872 * @return length of the resulting normalized string.
874 * @see ucol_openFromShortString
875 * @see ucol_getShortDefinitionString
880 U_STABLE
int32_t U_EXPORT2
881 ucol_normalizeShortDefinitionString(const char *source
,
884 UParseError
*parseError
,
889 * Get a sort key for a string from a UCollator.
890 * Sort keys may be compared using <TT>strcmp</TT>.
892 * Like ICU functions that write to an output buffer, the buffer contents
893 * is undefined if the buffer capacity (resultLength parameter) is too small.
894 * Unlike ICU functions that write a string to an output buffer,
895 * the terminating zero byte is counted in the sort key length.
896 * @param coll The UCollator containing the collation rules.
897 * @param source The string to transform.
898 * @param sourceLength The length of source, or -1 if null-terminated.
899 * @param result A pointer to a buffer to receive the attribute.
900 * @param resultLength The maximum size of result.
901 * @return The size needed to fully store the sort key.
902 * If there was an internal error generating the sort key,
903 * a zero value is returned.
904 * @see ucol_keyHashCode
907 U_STABLE
int32_t U_EXPORT2
908 ucol_getSortKey(const UCollator
*coll
,
910 int32_t sourceLength
,
912 int32_t resultLength
);
915 /** Gets the next count bytes of a sort key. Caller needs
916 * to preserve state array between calls and to provide
917 * the same type of UCharIterator set with the same string.
918 * The destination buffer provided must be big enough to store
919 * the number of requested bytes. Generated sortkey is not
920 * compatible with sortkeys generated using ucol_getSortKey
921 * API, since we don't do any compression. If uncompressed
922 * sortkeys are required, this API can be used.
923 * @param coll The UCollator containing the collation rules.
924 * @param iter UCharIterator containing the string we need
925 * the sort key to be calculated for.
926 * @param state Opaque state of sortkey iteration.
927 * @param dest Buffer to hold the resulting sortkey part
928 * @param count number of sort key bytes required.
929 * @param status error code indicator.
930 * @return the actual number of bytes of a sortkey. It can be
931 * smaller than count if we have reached the end of
935 U_STABLE
int32_t U_EXPORT2
936 ucol_nextSortKeyPart(const UCollator
*coll
,
939 uint8_t *dest
, int32_t count
,
942 /** enum that is taken by ucol_getBound API
943 * See below for explanation
944 * do not change the values assigned to the
945 * members of this enum. Underlying code
946 * depends on them having these numbers
951 UCOL_BOUND_LOWER
= 0,
952 /** upper bound that will match strings of exact size */
953 UCOL_BOUND_UPPER
= 1,
954 /** upper bound that will match all the strings that have the same initial substring as the given string */
955 UCOL_BOUND_UPPER_LONG
= 2,
956 UCOL_BOUND_VALUE_COUNT
960 * Produce a bound for a given sortkey and a number of levels.
961 * Return value is always the number of bytes needed, regardless of
962 * whether the result buffer was big enough or even valid.<br>
963 * Resulting bounds can be used to produce a range of strings that are
964 * between upper and lower bounds. For example, if bounds are produced
965 * for a sortkey of string "smith", strings between upper and lower
966 * bounds with one level would include "Smith", "SMITH", "sMiTh".<br>
967 * There are two upper bounds that can be produced. If UCOL_BOUND_UPPER
968 * is produced, strings matched would be as above. However, if bound
969 * produced using UCOL_BOUND_UPPER_LONG is used, the above example will
970 * also match "Smithsonian" and similar.<br>
971 * For more on usage, see example in cintltst/capitst.c in procedure
973 * Sort keys may be compared using <TT>strcmp</TT>.
974 * @param source The source sortkey.
975 * @param sourceLength The length of source, or -1 if null-terminated.
976 * (If an unmodified sortkey is passed, it is always null
978 * @param boundType Type of bound required. It can be UCOL_BOUND_LOWER, which
979 * produces a lower inclusive bound, UCOL_BOUND_UPPER, that
980 * produces upper bound that matches strings of the same length
981 * or UCOL_BOUND_UPPER_LONG that matches strings that have the
982 * same starting substring as the source string.
983 * @param noOfLevels Number of levels required in the resulting bound (for most
984 * uses, the recommended value is 1). See users guide for
985 * explanation on number of levels a sortkey can have.
986 * @param result A pointer to a buffer to receive the resulting sortkey.
987 * @param resultLength The maximum size of result.
988 * @param status Used for returning error code if something went wrong. If the
989 * number of levels requested is higher than the number of levels
990 * in the source key, a warning (U_SORT_KEY_TOO_SHORT_WARNING) is
992 * @return The size needed to fully store the bound.
993 * @see ucol_keyHashCode
996 U_STABLE
int32_t U_EXPORT2
997 ucol_getBound(const uint8_t *source
,
998 int32_t sourceLength
,
999 UColBoundMode boundType
,
1000 uint32_t noOfLevels
,
1002 int32_t resultLength
,
1003 UErrorCode
*status
);
1006 * Gets the version information for a Collator. Version is currently
1007 * an opaque 32-bit number which depends, among other things, on major
1008 * versions of the collator tailoring and UCA.
1009 * @param coll The UCollator to query.
1010 * @param info the version # information, the result will be filled in
1013 U_STABLE
void U_EXPORT2
1014 ucol_getVersion(const UCollator
* coll
, UVersionInfo info
);
1017 * Gets the UCA version information for a Collator. Version is the
1018 * UCA version number (3.1.1, 4.0).
1019 * @param coll The UCollator to query.
1020 * @param info the version # information, the result will be filled in
1023 U_STABLE
void U_EXPORT2
1024 ucol_getUCAVersion(const UCollator
* coll
, UVersionInfo info
);
1027 * Merge two sort keys. The levels are merged with their corresponding counterparts
1028 * (primaries with primaries, secondaries with secondaries etc.). Between the values
1029 * from the same level a separator is inserted.
1030 * example (uncompressed):
1031 * 191B1D 01 050505 01 910505 00 and 1F2123 01 050505 01 910505 00
1033 * 191B1D 02 1F212301 050505 02 050505 01 910505 02 910505 00
1034 * This allows for concatenating of first and last names for sorting, among other things.
1035 * If the destination buffer is not big enough, the results are undefined.
1036 * If any of source lengths are zero or any of source pointers are NULL/undefined,
1037 * result is of size zero.
1038 * @param src1 pointer to the first sortkey
1039 * @param src1Length length of the first sortkey
1040 * @param src2 pointer to the second sortkey
1041 * @param src2Length length of the second sortkey
1042 * @param dest buffer to hold the result
1043 * @param destCapacity size of the buffer for the result
1044 * @return size of the result. If the buffer is big enough size is always
1045 * src1Length+src2Length-1
1048 U_STABLE
int32_t U_EXPORT2
1049 ucol_mergeSortkeys(const uint8_t *src1
, int32_t src1Length
,
1050 const uint8_t *src2
, int32_t src2Length
,
1051 uint8_t *dest
, int32_t destCapacity
);
1054 * Universal attribute setter
1055 * @param coll collator which attributes are to be changed
1056 * @param attr attribute type
1057 * @param value attribute value
1058 * @param status to indicate whether the operation went on smoothly or there were errors
1059 * @see UColAttribute
1060 * @see UColAttributeValue
1061 * @see ucol_getAttribute
1064 U_STABLE
void U_EXPORT2
1065 ucol_setAttribute(UCollator
*coll
, UColAttribute attr
, UColAttributeValue value
, UErrorCode
*status
);
1068 * Universal attribute getter
1069 * @param coll collator which attributes are to be changed
1070 * @param attr attribute type
1071 * @return attribute value
1072 * @param status to indicate whether the operation went on smoothly or there were errors
1073 * @see UColAttribute
1074 * @see UColAttributeValue
1075 * @see ucol_setAttribute
1078 U_STABLE UColAttributeValue U_EXPORT2
1079 ucol_getAttribute(const UCollator
*coll
, UColAttribute attr
, UErrorCode
*status
);
1082 * is a two byte primary value which causes all the codepoints with primary values that
1083 * are less or equal than the variable top to be shifted when alternate handling is set
1085 * Sets the variable top to a collation element value of a string supplied.
1086 * @param coll collator which variable top needs to be changed
1087 * @param varTop one or more (if contraction) UChars to which the variable top should be set
1088 * @param len length of variable top string. If -1 it is considered to be zero terminated.
1089 * @param status error code. If error code is set, the return value is undefined.
1090 * Errors set by this function are: <br>
1091 * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such
1093 * U_PRIMARY_TOO_LONG_ERROR if the primary for the variable top has more than two bytes
1094 * @return a 32 bit value containing the value of the variable top in upper 16 bits.
1095 * Lower 16 bits are undefined
1096 * @see ucol_getVariableTop
1097 * @see ucol_restoreVariableTop
1100 U_STABLE
uint32_t U_EXPORT2
1101 ucol_setVariableTop(UCollator
*coll
,
1102 const UChar
*varTop
, int32_t len
,
1103 UErrorCode
*status
);
1106 * Gets the variable top value of a Collator.
1107 * Lower 16 bits are undefined and should be ignored.
1108 * @param coll collator which variable top needs to be retrieved
1109 * @param status error code (not changed by function). If error code is set,
1110 * the return value is undefined.
1111 * @return the variable top value of a Collator.
1112 * @see ucol_setVariableTop
1113 * @see ucol_restoreVariableTop
1116 U_STABLE
uint32_t U_EXPORT2
ucol_getVariableTop(const UCollator
*coll
, UErrorCode
*status
);
1119 * Sets the variable top to a collation element value supplied. Variable top is
1120 * set to the upper 16 bits.
1121 * Lower 16 bits are ignored.
1122 * @param coll collator which variable top needs to be changed
1123 * @param varTop CE value, as returned by ucol_setVariableTop or ucol)getVariableTop
1124 * @param status error code (not changed by function)
1125 * @see ucol_getVariableTop
1126 * @see ucol_setVariableTop
1129 U_STABLE
void U_EXPORT2
1130 ucol_restoreVariableTop(UCollator
*coll
, const uint32_t varTop
, UErrorCode
*status
);
1133 * Thread safe cloning operation. The result is a clone of a given collator.
1134 * @param coll collator to be cloned
1135 * @param stackBuffer user allocated space for the new clone.
1136 * If NULL new memory will be allocated.
1137 * If buffer is not large enough, new memory will be allocated.
1138 * Clients can use the U_COL_SAFECLONE_BUFFERSIZE.
1139 * This will probably be enough to avoid memory allocations.
1140 * @param pBufferSize pointer to size of allocated space.
1141 * If *pBufferSize == 0, a sufficient size for use in cloning will
1142 * be returned ('pre-flighting')
1143 * If *pBufferSize is not enough for a stack-based safe clone,
1144 * new memory will be allocated.
1145 * @param status to indicate whether the operation went on smoothly or there were errors
1146 * An informational status value, U_SAFECLONE_ALLOCATED_ERROR, is used if any
1147 * allocations were necessary.
1148 * @return pointer to the new clone
1150 * @see ucol_openRules
1154 U_STABLE UCollator
* U_EXPORT2
1155 ucol_safeClone(const UCollator
*coll
,
1157 int32_t *pBufferSize
,
1158 UErrorCode
*status
);
1160 /** default memory size for the new clone. It needs to be this large for os/400 large pointers
1163 #define U_COL_SAFECLONE_BUFFERSIZE 528
1166 * Returns current rules. Delta defines whether full rules are returned or just the tailoring.
1167 * Returns number of UChars needed to store rules. If buffer is NULL or bufferLen is not enough
1168 * to store rules, will store up to available space.
1169 * @param coll collator to get the rules from
1170 * @param delta one of UCOL_TAILORING_ONLY, UCOL_FULL_RULES.
1171 * @param buffer buffer to store the result in. If NULL, you'll get no rules.
1172 * @param bufferLen lenght of buffer to store rules in. If less then needed you'll get only the part that fits in.
1173 * @return current rules
1176 U_STABLE
int32_t U_EXPORT2
1177 ucol_getRulesEx(const UCollator
*coll
, UColRuleOption delta
, UChar
*buffer
, int32_t bufferLen
);
1179 #ifndef U_HIDE_DEPRECATED_API
1181 * gets the locale name of the collator. If the collator
1182 * is instantiated from the rules, then this function returns
1184 * @param coll The UCollator for which the locale is needed
1185 * @param type You can choose between requested, valid and actual
1186 * locale. For description see the definition of
1187 * ULocDataLocaleType in uloc.h
1188 * @param status error code of the operation
1189 * @return real locale name from which the collation data comes.
1190 * If the collator was instantiated from rules, returns
1192 * @deprecated ICU 2.8 Use ucol_getLocaleByType instead
1194 U_DEPRECATED
const char * U_EXPORT2
1195 ucol_getLocale(const UCollator
*coll
, ULocDataLocaleType type
, UErrorCode
*status
);
1196 #endif /* U_HIDE_DEPRECATED_API */
1199 * gets the locale name of the collator. If the collator
1200 * is instantiated from the rules, then this function returns
1202 * @param coll The UCollator for which the locale is needed
1203 * @param type You can choose between requested, valid and actual
1204 * locale. For description see the definition of
1205 * ULocDataLocaleType in uloc.h
1206 * @param status error code of the operation
1207 * @return real locale name from which the collation data comes.
1208 * If the collator was instantiated from rules, returns
1212 U_STABLE
const char * U_EXPORT2
1213 ucol_getLocaleByType(const UCollator
*coll
, ULocDataLocaleType type
, UErrorCode
*status
);
1216 * Get an Unicode set that contains all the characters and sequences tailored in
1217 * this collator. The result must be disposed of by using uset_close.
1218 * @param coll The UCollator for which we want to get tailored chars
1219 * @param status error code of the operation
1220 * @return a pointer to newly created USet. Must be be disposed by using uset_close
1221 * @see ucol_openRules
1225 U_STABLE USet
* U_EXPORT2
1226 ucol_getTailoredSet(const UCollator
*coll
, UErrorCode
*status
);
1228 #ifndef U_HIDE_INTERNAL_API
1230 * Universal attribute getter that returns UCOL_DEFAULT if the value is default
1231 * @param coll collator which attributes are to be changed
1232 * @param attr attribute type
1233 * @return attribute value or UCOL_DEFAULT if the value is default
1234 * @param status to indicate whether the operation went on smoothly or there were errors
1235 * @see UColAttribute
1236 * @see UColAttributeValue
1237 * @see ucol_setAttribute
1240 U_INTERNAL UColAttributeValue U_EXPORT2
1241 ucol_getAttributeOrDefault(const UCollator
*coll
, UColAttribute attr
, UErrorCode
*status
);
1243 /** Check whether two collators are equal. Collators are considered equal if they
1244 * will sort strings the same. This means that both the current attributes and the
1245 * rules must be equivalent. Currently used for RuleBasedCollator::operator==.
1246 * @param source first collator
1247 * @param target second collator
1248 * @return TRUE or FALSE
1251 U_INTERNAL UBool U_EXPORT2
1252 ucol_equals(const UCollator
*source
, const UCollator
*target
);
1254 /** Calculates the set of unsafe code points, given a collator.
1255 * A character is unsafe if you could append any character and cause the ordering to alter significantly.
1256 * Collation sorts in normalized order, so anything that rearranges in normalization can cause this.
1257 * Thus if you have a character like a_umlaut, and you add a lower_dot to it,
1258 * then it normalizes to a_lower_dot + umlaut, and sorts differently.
1259 * @param coll Collator
1260 * @param unsafe a fill-in set to receive the unsafe points
1261 * @param status for catching errors
1262 * @return number of elements in the set
1265 U_INTERNAL
int32_t U_EXPORT2
1266 ucol_getUnsafeSet( const UCollator
*coll
,
1268 UErrorCode
*status
);
1270 /** Reset UCA's static pointers. You don't want to use this, unless your static memory can go away.
1271 * @internal ICU 3.2.1
1273 U_INTERNAL
void U_EXPORT2
1274 ucol_forgetUCA(void);
1276 /** Touches all resources needed for instantiating a collator from a short string definition,
1277 * thus filling up the cache.
1278 * @param definition A short string containing a locale and a set of attributes.
1279 * Attributes not explicitly mentioned are left at the default
1280 * state for a locale.
1281 * @param parseError if not NULL, structure that will get filled with error's pre
1282 * and post context in case of error.
1283 * @param forceDefaults if FALSE, the settings that are the same as the collator
1284 * default settings will not be applied (for example, setting
1285 * French secondary on a French collator would not be executed).
1286 * If TRUE, all the settings will be applied regardless of the
1287 * collator default value. If the definition
1288 * strings are to be cached, should be set to FALSE.
1289 * @param status Error code. Apart from regular error conditions connected to
1290 * instantiating collators (like out of memory or similar), this
1291 * API will return an error if an invalid attribute or attribute/value
1292 * combination is specified.
1293 * @see ucol_openFromShortString
1294 * @internal ICU 3.2.1
1296 U_INTERNAL
void U_EXPORT2
1297 ucol_prepareShortStringOpen( const char *definition
,
1298 UBool forceDefaults
,
1299 UParseError
*parseError
,
1300 UErrorCode
*status
);
1301 #endif /* U_HIDE_INTERNAL_API */
1303 /** Creates a binary image of a collator. This binary image can be stored and
1304 * later used to instantiate a collator using ucol_openBinary.
1305 * This API supports preflighting.
1306 * @param coll Collator
1307 * @param buffer a fill-in buffer to receive the binary image
1308 * @param capacity capacity of the destination buffer
1309 * @param status for catching errors
1310 * @return size of the image
1311 * @see ucol_openBinary
1314 U_STABLE
int32_t U_EXPORT2
1315 ucol_cloneBinary(const UCollator
*coll
,
1316 uint8_t *buffer
, int32_t capacity
,
1317 UErrorCode
*status
);
1319 /** Opens a collator from a collator binary image created using
1320 * ucol_cloneBinary. Binary image used in instantiation of the
1321 * collator remains owned by the user and should stay around for
1322 * the lifetime of the collator. The API also takes a base collator
1323 * which usualy should be UCA.
1324 * @param bin binary image owned by the user and required through the
1325 * lifetime of the collator
1326 * @param length size of the image. If negative, the API will try to
1327 * figure out the length of the image
1328 * @param base fallback collator, usually UCA. Base is required to be
1329 * present through the lifetime of the collator. Currently
1330 * it cannot be NULL.
1331 * @param status for catching errors
1332 * @return newly created collator
1333 * @see ucol_cloneBinary
1336 U_STABLE UCollator
* U_EXPORT2
1337 ucol_openBinary(const uint8_t *bin
, int32_t length
,
1338 const UCollator
*base
,
1339 UErrorCode
*status
);
1342 #endif /* #if !UCONFIG_NO_COLLATION */