C++11 case insensitive comparison of beginning of a string (unicode)

后端 未结 3 466
青春惊慌失措
青春惊慌失措 2021-01-05 01:45

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

3条回答
  •  逝去的感伤
    2021-01-05 02:17

    The only way I know of that is UTF8/internationalization/culture-aware is the excellent and well-maintained IBM ICU: International Components for Unicode. It's a C/C++ library for *nix or Windows into which a ton of research has gone to provide a culture-aware string library, including case-insensitive string comparison that's both fast and accurate.

    IMHO, the two things you should never write yourself unless you're doing a thesis paper are encryption and culture-sensitive string libraries.

提交回复
热议问题