Go to the documentation of this file.
25 #if !UCONFIG_NO_NORMALIZATION
28 #if U_SHOW_CPLUSPLUS_API
214 #ifndef U_HIDE_DEPRECATED_API
393 const char *confusablesWholeScript, int32_t confusablesWholeScriptLen,
405 #if U_SHOW_CPLUSPLUS_API
604 #if U_SHOW_CPLUSPLUS_API
680 const UChar *
id, int32_t length,
714 const char *
id, int32_t length,
719 #if U_SHOW_CPLUSPLUS_API
793 const UChar *id1, int32_t length1,
794 const UChar *id2, int32_t length2,
826 const char *id1, int32_t length1,
827 const char *id2, int32_t length2,
833 #if U_SHOW_CPLUSPLUS_API
898 const UChar *
id, int32_t length,
899 UChar *dest, int32_t destCapacity,
940 const char *
id, int32_t length,
941 char *dest, int32_t destCapacity,
944 #if U_SHOW_CPLUSPLUS_API
1006 #if U_SHOW_CPLUSPLUS_API
1062 void *data, int32_t capacity,
@ USPOOF_ASCII
Only ASCII characters: U+0000..U+007F.
USpoofChecks
Enum for the kinds of checks that USpoofChecker can perform.
C API: Parse Error Information.
URestrictionLevel uspoof_getRestrictionLevel(const USpoofChecker *sc)
Get the Restriction Level that will be tested if the checks include RESTRICTION_LEVEL.
@ USPOOF_RESTRICTION_LEVEL_MASK
Mask for selecting the Restriction Level bits from the return value of uspoof_check().
Basic definitions for ICU, for both C and C++ APIs.
A mutable set of Unicode characters and multicharacter strings.
@ USPOOF_ANY_CASE
Any Case Modifier for confusable identifier tests.
@ USPOOF_UNRESTRICTIVE
Any valid identifiers, including characters outside of the Identifier Profile.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
U_I18N_API icu::UnicodeString & uspoof_getSkeletonUnicodeString(const USpoofChecker *sc, uint32_t type, const icu::UnicodeString &id, icu::UnicodeString &dest, UErrorCode *status)
Get the "skeleton" for an identifier.
int32_t uspoof_areConfusable(const USpoofChecker *sc, const UChar *id1, int32_t length1, const UChar *id2, int32_t length2, UErrorCode *status)
Check the whether two specified strings are visually confusable.
const icu::UnicodeSet * uspoof_getRecommendedUnicodeSet(UErrorCode *status)
Get the set of characters from Recommended Scripts for Inclusion in Identifiers, as defined in Unicod...
int32_t uspoof_getChecks(const USpoofChecker *sc, UErrorCode *status)
Get the set of checks that this Spoof Checker has been configured to perform.
const icu::UnicodeSet * uspoof_getAllowedUnicodeSet(const USpoofChecker *sc, UErrorCode *status)
Get a UnicodeSet for the characters permitted in an identifier.
const USet * uspoof_getRecommendedSet(UErrorCode *status)
Get the set of characters from Recommended Scripts for Inclusion in Identifiers, as defined in Unicod...
const USet * uspoof_getAllowedChars(const USpoofChecker *sc, UErrorCode *status)
Get a USet for the characters permitted in an identifier.
@ USPOOF_HIGHLY_RESTRICTIVE
All characters in each identifier must be from a single script, or from the combinations: Latin + Han...
void uspoof_setAllowedUnicodeSet(USpoofChecker *sc, const icu::UnicodeSet *chars, UErrorCode *status)
Limit the acceptable characters to those specified by a Unicode Set.
const USet * uspoof_getInclusionSet(UErrorCode *status)
Get the set of Candidate Characters for Inclusion in Identifiers, as defined in Unicode UAX #31,...
int32_t uspoof_checkUTF8(const USpoofChecker *sc, const char *id, int32_t length, int32_t *position, UErrorCode *status)
Check the specified string for possible security issues.
A UParseError struct is used to returned detailed information about parsing errors.
@ USPOOF_CHAR_LIMIT
Check that an identifier contains only characters from a specified set of acceptable characters.
@ USPOOF_ALL_CHECKS
Enable all spoof checks.
int32_t uspoof_serialize(USpoofChecker *sc, void *data, int32_t capacity, UErrorCode *status)
Serialize the data for a spoof detector into a chunk of memory.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
void uspoof_setRestrictionLevel(USpoofChecker *sc, URestrictionLevel restrictionLevel)
Set the loosest restriction level allowed.
int32_t uspoof_checkUnicodeString(const USpoofChecker *sc, const icu::UnicodeString &id, int32_t *position, UErrorCode *status)
Check the specified string for possible security issues.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
@ USPOOF_SINGLE_SCRIPT_RESTRICTIVE
All characters in each identifier must be from a single script.
USpoofChecker * uspoof_openFromSource(const char *confusables, int32_t confusablesLen, const char *confusablesWholeScript, int32_t confusablesWholeScriptLen, int32_t *errType, UParseError *pe, UErrorCode *status)
Open a Spoof Checker from the source form of the spoof data.
const icu::UnicodeSet * uspoof_getInclusionUnicodeSet(UErrorCode *status)
Get the set of Candidate Characters for Inclusion in Identifiers, as defined in Unicode UAX #31,...
@ USPOOF_SINGLE_SCRIPT
Check that an identifier contains only characters from a single script (plus chars from the common an...
USpoofChecker * uspoof_open(UErrorCode *status)
Create a Unicode Spoof Checker, configured to perform all checks except for USPOOF_LOCALE_LIMIT and U...
const char * uspoof_getAllowedLocales(USpoofChecker *sc, UErrorCode *status)
Get a list of locales for the scripts that are acceptable in strings to be checked.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
@ USPOOF_SINGLE_SCRIPT_CONFUSABLE
Single script confusable test.
@ USPOOF_MIXED_NUMBERS
Check that an identifier does not include decimal digits from more than one numbering system.
@ USPOOF_AUX_INFO
Enable the return of auxillary (non-error) information in the upper bits of the check results value.
int32_t uspoof_areConfusableUnicodeString(const USpoofChecker *sc, const icu::UnicodeString &s1, const icu::UnicodeString &s2, UErrorCode *status)
Check the whether two specified strings are visually confusable.
int32_t uspoof_getSkeleton(const USpoofChecker *sc, uint32_t type, const UChar *id, int32_t length, UChar *dest, int32_t destCapacity, UErrorCode *status)
Get the "skeleton" for an identifier.
USpoofChecker * uspoof_clone(const USpoofChecker *sc, UErrorCode *status)
Clone a Spoof Checker.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
void uspoof_setAllowedChars(USpoofChecker *sc, const USet *chars, UErrorCode *status)
Limit the acceptable characters to those specified by a Unicode Set.
void uspoof_setAllowedLocales(USpoofChecker *sc, const char *localesList, UErrorCode *status)
Limit characters that are acceptable in identifiers being checked to those normally used with the lan...
USpoofChecker * uspoof_openFromSerialized(const void *data, int32_t length, int32_t *pActualLength, UErrorCode *pErrorCode)
Open a Spoof checker from its serialized form, stored in 32-bit-aligned memory.
@ USPOOF_MINIMALLY_RESTRICTIVE
Allow arbitrary mixtures of scripts.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
struct USpoofChecker USpoofChecker
typedef for C of USpoofChecker
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
@ USPOOF_MODERATELY_RESTRICTIVE
Allow Latin with other scripts except Cyrillic, Greek, Cherokee Otherwise, the same as Highly Restric...
int32_t uspoof_check(const USpoofChecker *sc, const UChar *id, int32_t length, int32_t *position, UErrorCode *status)
Check the specified string for possible security issues.
void uspoof_setChecks(USpoofChecker *sc, int32_t checks, UErrorCode *status)
Specify the set of checks that will be performed by the check functions of this Spoof Checker.
int32_t uspoof_areConfusableUTF8(const USpoofChecker *sc, const char *id1, int32_t length1, const char *id2, int32_t length2, UErrorCode *status)
Check the whether two specified strings are visually confusable.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
void uspoof_close(USpoofChecker *sc)
Close a Spoof Checker, freeing any memory that was being held by its implementation.
"Smart pointer" class, closes a USpoofChecker via uspoof_close().
URestrictionLevel
Constants from UAX #39 for use in setRestrictionLevel(), and for returned identifier restriction leve...
int32_t uspoof_getSkeletonUTF8(const USpoofChecker *sc, uint32_t type, const char *id, int32_t length, char *dest, int32_t destCapacity, UErrorCode *status)
Get the "skeleton" for an identifier.
@ USPOOF_RESTRICTION_LEVEL
Check that an identifier is no looser than the specified RestrictionLevel.
@ USPOOF_WHOLE_SCRIPT_CONFUSABLE
Whole script confusable test.
@ USPOOF_INVISIBLE
Check an identifier for the presence of invisible characters, such as zero-width spaces,...
@ USPOOF_MIXED_SCRIPT_CONFUSABLE
Mixed script confusable test.