VirtualBox

Changeset 1703 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 26, 2007 12:44:40 PM (18 years ago)
Author:
vboxsync
Message:

Added case-insensitive UTF-8 string compare (implemented via C library
functions for now).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/utf-8.cpp

    r1 r1703  
    957957}
    958958
     959
     960/**
     961 * Performs a case insensitive string compare between two UTF-8 strings.
     962 *
     963 * This is a simplified compare, as only the simplified lower/upper case folding
     964 * specified by the unicode specs are used. It does not consider character pairs
     965 * as they are used in some languages, just simple upper & lower case compares.
     966 *
     967 * @returns < 0 if the first string less than the second string.
     968 * @returns 0 if the first string identical to the second string.
     969 * @returns > 0 if the first string greater than the second string.
     970 * @param   psz1        First UTF-8 string.
     971 * @param   psz2        Second UTF-8 string.
     972 */
     973RTDECL(int) RTStrICmp(const char *psz1, const char *psz2)
     974{
     975    /** @todo implement proper UTF-8 case-insensitive string comparison. */
     976#ifdef __WIN32__
     977    return stricmp(psz1, psz2);
     978#else /* !__WIN32__ */
     979    return strcasecmp(psz1, psz2);
     980#endif /* !__WIN32__ */
     981}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette