27 #if !UCONFIG_NO_NORMALIZATION 30 #if U_SHOW_CPLUSPLUS_API 485 #ifndef U_HIDE_DEPRECATED_API 509 #ifndef U_HIDE_DEPRECATED_API 650 #ifndef U_HIDE_INTERNAL_API 730 const char *confusablesWholeScript, int32_t confusablesWholeScriptLen,
903 U_CAPI const char * U_EXPORT2
987 const UChar *
id, int32_t length,
1026 const char *
id, int32_t length,
1061 const UChar*
id, int32_t length,
1098 const char *
id, int32_t length,
1223 const UChar *id1, int32_t length1,
1224 const UChar *id2, int32_t length2,
1274 const UChar *id1, int32_t length1,
1275 const UChar *id2, int32_t length2,
1305 const char *id1, int32_t length1,
1306 const char *id2, int32_t length2,
1337 const char *id1, int32_t length1,
1338 const char *id2, int32_t length2,
1375 const UChar *
id, int32_t length,
1376 UChar *dest, int32_t destCapacity,
1413 const UChar *
id, int32_t length,
1452 const char *
id, int32_t length,
1453 char *dest, int32_t destCapacity,
1491 const char *
id, int32_t length,
char *dest,
1548 void *data, int32_t capacity,
1553 #if U_SHOW_CPLUSPLUS_API U_CAPI const USet *U_EXPORT2 uspoof_getAllowedChars(const USpoofChecker *sc, UErrorCode *status)
Get a USet for the characters permitted in an identifier.
U_CAPI USpoofChecker * uspoof_open(UErrorCode *status)
Create a Unicode Spoof Checker, configured to perform all checks except for USPOOF_LOCALE_LIMIT and U...
U_CAPI uint32_t U_EXPORT2 uspoof_areBidiConfusableUnicodeString(const USpoofChecker *sc, UBiDiDirection direction, const icu::UnicodeString &s1, const icu::UnicodeString &s2, UErrorCode *status)
A version of uspoof_areBidiConfusable accepting UnicodeStrings.
U_CAPI int32_t U_EXPORT2 uspoof_check2UTF8(const USpoofChecker *sc, const char *id, int32_t length, USpoofCheckResult *checkResult, UErrorCode *status)
Check the specified string for possible security issues.
U_CAPI int32_t U_EXPORT2 uspoof_areConfusableUTF8(const USpoofChecker *sc, const char *id1, int32_t length1, const char *id2, int32_t length2, UErrorCode *status)
A version of uspoof_areConfusable accepting strings in UTF-8 format.
URestrictionLevel
Constants from UTS #39 for use in uspoof_setRestrictionLevel, and for returned identifier restriction...
#define U_CAPI
This is used to declare a function as a public ICU C API.
U_CAPI void U_EXPORT2 uspoof_setChecks(USpoofChecker *sc, int32_t checks, UErrorCode *status)
Specify the bitmask of checks that will be performed by uspoof_check.
U_CAPI void U_EXPORT2 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...
U_CAPI int32_t U_EXPORT2 uspoof_check2(const USpoofChecker *sc, const UChar *id, int32_t length, USpoofCheckResult *checkResult, UErrorCode *status)
Check the specified string for possible security issues.
U_CAPI const USet *U_EXPORT2 uspoof_getInclusionSet(UErrorCode *status)
Get the set of Candidate Characters for Inclusion in Identifiers, as defined in http://unicode.org/Public/security/latest/xidmodifications.txt and documented in http://www.unicode.org/reports/tr39/, Unicode Security Mechanisms.
Check an identifier for the presence of invisible characters, such as zero-width spaces, or character sequences that are likely not to display, such as multiple occurrences of the same non-spacing mark.
Check that an identifier contains only characters from a single script (plus chars from the common an...
struct USpoofCheckResult USpoofCheckResult
U_CAPI int32_t U_EXPORT2 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.
U_CAPI int32_t U_EXPORT2 uspoof_serialize(USpoofChecker *sc, void *data, int32_t capacity, UErrorCode *status)
Serialize the data for a spoof detector into a chunk of memory.
U_CAPI const icu::UnicodeSet *U_EXPORT2 uspoof_getInclusionUnicodeSet(UErrorCode *status)
Get the set of Candidate Characters for Inclusion in Identifiers, as defined in http://unicode.org/Public/security/latest/xidmodifications.txt and documented in http://www.unicode.org/reports/tr39/, Unicode Security Mechanisms.
All characters in the string are in the identifier profile and all characters in the string are in th...
U_NAMESPACE_END U_CAPI void U_EXPORT2 uspoof_setAllowedUnicodeSet(USpoofChecker *sc, const icu::UnicodeSet *chars, UErrorCode *status)
Limit the acceptable characters to those specified by a Unicode Set.
U_CAPI int32_t U_EXPORT2 uspoof_check(const USpoofChecker *sc, const UChar *id, int32_t length, int32_t *position, UErrorCode *status)
Check the specified string for possible security issues.
U_I18N_API icu::UnicodeString &U_EXPORT2 uspoof_getSkeletonUnicodeString(const USpoofChecker *sc, uint32_t type, const icu::UnicodeString &id, icu::UnicodeString &dest, UErrorCode *status)
Get the "skeleton" for an identifier.
Check that an identifier contains only characters from a specified set of acceptable characters...
U_CAPI 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.
All characters in the string are in the identifier profile.
USpoofChecks
Enum for the kinds of checks that USpoofChecker can perform.
U_CAPI int32_t U_EXPORT2 uspoof_getChecks(const USpoofChecker *sc, UErrorCode *status)
Get the set of checks that this Spoof Checker has been configured to perform.
U_CAPI const icu::UnicodeSet *U_EXPORT2 uspoof_getRecommendedUnicodeSet(UErrorCode *status)
Get the set of characters from Recommended Scripts for Inclusion in Identifiers, as defined in http:/...
Enable this flag in uspoof_setChecks to turn on all types of confusables.
U_CAPI void uspoof_close(USpoofChecker *sc)
Close a Spoof Checker, freeing any memory that was being held by its implementation.
UBiDiDirection
UBiDiDirection values indicate the text direction.
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
U_CAPI void U_EXPORT2 uspoof_closeCheckResult(USpoofCheckResult *checkResult)
Close a USpoofCheckResult, freeing any memory that was being held by its implementation.
U_CAPI int32_t U_EXPORT2 uspoof_areConfusableUnicodeString(const USpoofChecker *sc, const icu::UnicodeString &s1, const icu::UnicodeString &s2, UErrorCode *status)
A version of uspoof_areConfusable accepting UnicodeStrings.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
U_CAPI int32_t U_EXPORT2 uspoof_checkUTF8(const USpoofChecker *sc, const char *id, int32_t length, int32_t *position, UErrorCode *status)
Check the specified string for possible security issues.
U_CAPI URestrictionLevel U_EXPORT2 uspoof_getRestrictionLevel(const USpoofChecker *sc)
Get the Restriction Level that will be tested if the checks include USPOOF_RESTRICTION_LEVEL.
Check that an identifier does not have a combining character following a character in which that comb...
This flag is deprecated and no longer affects the behavior of SpoofChecker.
U_CAPI int32_t U_EXPORT2 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.
When performing the two-string uspoof_areConfusable test, this flag in the return value indicates tha...
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
U_CAPI 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.
U_I18N_API icu::UnicodeString &U_EXPORT2 uspoof_getBidiSkeletonUnicodeString(const USpoofChecker *sc, UBiDiDirection direction, const icu::UnicodeString &id, icu::UnicodeString &dest, UErrorCode *status)
Get the "bidiSkeleton" for an identifier and a direction.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
U_CAPI uint32_t U_EXPORT2 uspoof_areBidiConfusable(const USpoofChecker *sc, UBiDiDirection direction, const UChar *id1, int32_t length1, const UChar *id2, int32_t length2, UErrorCode *status)
Check whether two specified strings are visually confusable when displayed in a context with the give...
The string classifies as Highly Restrictive, or all characters in the string are in the identifier pr...
Check that an identifier does not mix numbers from different numbering systems.
U_CAPI int32_t U_EXPORT2 uspoof_check2UnicodeString(const USpoofChecker *sc, const icu::UnicodeString &id, USpoofCheckResult *checkResult, UErrorCode *status)
Check the specified string for possible security issues.
U_CAPI int32_t U_EXPORT2 uspoof_checkUnicodeString(const USpoofChecker *sc, const icu::UnicodeString &id, int32_t *position, UErrorCode *status)
Check the specified string for possible security issues.
U_CAPI const USet *U_EXPORT2 uspoof_getCheckResultNumerics(const USpoofCheckResult *checkResult, UErrorCode *status)
Gets the set of numerics found in the string, if the USPOOF_MIXED_NUMBERS check was enabled; otherwis...
The string classifies as ASCII-Only, or all characters in the string are in the identifier profile an...
U_CAPI int32_t U_EXPORT2 uspoof_getBidiSkeleton(const USpoofChecker *sc, UBiDiDirection direction, const UChar *id, int32_t length, UChar *dest, int32_t destCapacity, UErrorCode *status)
Get the "bidiSkeleton" for an identifier and a direction.
The string classifies as Single Script, or all characters in the string are in the identifier profile...
A mutable set of Unicode characters and multicharacter strings.
struct USpoofChecker USpoofChecker
typedef for C of USpoofChecker
"Smart pointer" class, closes a USpoofChecker via uspoof_close().
U_CAPI const icu::UnicodeSet *U_EXPORT2 uspoof_getAllowedUnicodeSet(const USpoofChecker *sc, UErrorCode *status)
Get a UnicodeSet for the characters permitted in an identifier.
U_CAPI int32_t U_EXPORT2 uspoof_getBidiSkeletonUTF8(const USpoofChecker *sc, UBiDiDirection direction, const char *id, int32_t length, char *dest, int32_t destCapacity, UErrorCode *status)
Get the "bidiSkeleton" for an identifier and a direction.
When performing the two-string uspoof_areConfusable test, this flag in the return value indicates tha...
char16_t UChar
The base type for UTF-16 code units and pointers.
U_CAPI URestrictionLevel U_EXPORT2 uspoof_getCheckResultRestrictionLevel(const USpoofCheckResult *checkResult, UErrorCode *status)
Gets the restriction level that the text meets, if the USPOOF_RESTRICTION_LEVEL check was enabled; ot...
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
U_CAPI void U_EXPORT2 uspoof_setRestrictionLevel(USpoofChecker *sc, URestrictionLevel restrictionLevel)
Set the loosest restriction level allowed for strings.
C API: Parse Error Information.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
When performing the two-string uspoof_areConfusable test, this flag in the return value indicates tha...
struct USet USet
USet is the C API type corresponding to C++ class UnicodeSet.
U_CAPI int32_t U_EXPORT2 uspoof_areConfusable(const USpoofChecker *sc, const UChar *id1, int32_t length1, const UChar *id2, int32_t length2, UErrorCode *status)
Check whether two specified strings are visually confusable.
U_CAPI uint32_t U_EXPORT2 uspoof_areBidiConfusableUTF8(const USpoofChecker *sc, UBiDiDirection direction, const char *id1, int32_t length1, const char *id2, int32_t length2, UErrorCode *status)
A version of uspoof_areBidiConfusable accepting strings in UTF-8 format.
Enable the return of auxiliary (non-error) information in the upper bits of the check results value...
U_CAPI const char *U_EXPORT2 uspoof_getAllowedLocales(USpoofChecker *sc, UErrorCode *status)
Get a list of locales for the scripts that are acceptable in strings to be checked.
Check that an identifier is no looser than the specified RestrictionLevel.
A UParseError struct is used to returned detailed information about parsing errors.
Basic definitions for ICU, for both C and C++ APIs.
Mask for selecting the Restriction Level bits from the return value of uspoof_check.
U_CAPI void U_EXPORT2 uspoof_setAllowedChars(USpoofChecker *sc, const USet *chars, UErrorCode *status)
Limit the acceptable characters to those specified by a Unicode Set.
Any valid identifiers, including characters outside of the Identifier Profile.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
"Smart pointer" class, closes a USpoofCheckResult via uspoof_closeCheckResult().
U_CAPI USpoofChecker * uspoof_clone(const USpoofChecker *sc, UErrorCode *status)
Clone a Spoof Checker.
U_CAPI const USet *U_EXPORT2 uspoof_getRecommendedSet(UErrorCode *status)
Get the set of characters from Recommended Scripts for Inclusion in Identifiers, as defined in http:/...
U_CAPI int32_t U_EXPORT2 uspoof_getCheckResultChecks(const USpoofCheckResult *checkResult, UErrorCode *status)
Indicates which of the spoof check(s) have failed.
An undefined restriction level.
U_CAPI USpoofCheckResult *U_EXPORT2 uspoof_openCheckResult(UErrorCode *status)
Create a USpoofCheckResult, used by the uspoof_check2 class of functions to return information about ...