I have to check if the particular string begins with another one. Strings are encoded using utf8, and a comparison should be case insensitive.
I know that this is ve
Are there any restrictions on what can be in the string you're looking
for? It it's user input, and can be any UTF-8 string, the problem is
extremely complex. As others have mentioned, one character can have
several different representations, so you'd probably have to normalize
the strings first. Then: what counts as equal? Should 'E'
compare
equal to 'é'
(as is usual in some circles in French), or not (which
would be conform to the "official" rules of the Imprimerie nationale).
For all but the most trivial definitions, rolling your own will represent a significant effort. For this sort of thing, the library ICU is the reference. It contains all that you'll need. Note however that it works on UTF16, not UTF8, so you'll have to convert the strings first, as well as normalizing them. (ICU has support for both.)