![]() ![]() But neither the C nor the C++ standard defines such a locale check with your vendor (too many embedded vendors, sorry, no genearl answer here). They're perfectly valid multi-byte char* strings, if you have an appropriate locale. UTF-8 strings add extra complexity to the question. "i" is uppercased to "İ" (U+130 Latin Capital I with dot above) The simple counter-example is "i" "I" ? The naive answer is no, but in Turkish these strings are unequal. There is no locale-independent, case-insensitive way of sorting strings. What you really want is logically impossible. This is printed: strcasecmp('Äaa', 'äaa') = -32Īnd yes, I am aware about ICU, but we can't use it on the embedded platform due to its enormous size. The results are unspecified in other locales.Īnd, indeed, the result of strcasecmp does not change between locales on Linux with GLIBC. In the POSIX locale, strcasecmp() and strncasecmp() do upper to lower conversions, then a byte comparison. I tried to use a POSIX strcasecmp, but it seems to be not defined for locales other than "POSIX" (Are there case-insensitive versions of these?) strcoll with C locales and std::collate/ std::collate_byname are case-sensitive.Options include using standard C or C++ library or a small (suitable for embedded system) and non-GPL (suitable for a proprietary system) third-party library.However I won't be holding my breath, as far as I know, collation is very language-dependent, so anything that works on languages other than English will do, even if it means switching locales. The method should ideally be locale-independent.I am looking for a method to compare and sort UTF-8 strings in C++ in a case-insensitive manner to use it in a custom collation function in SQLite. Export database from SQLitestudio to SQL format.Android SQLlite Select by Numeric field.Saving data with SQLite and adding it to a ListView. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |