c++icuboost-locale

Boost Locale – accessing ICU functions directly


I recently began using Boost Locale traversing and boundary analysis of Unicode strings. I’ve used some of the features available for case conversion, i.e.: to_upper(), which appears to wrap ICU’s toUpper() function.

I didn't find Boost Locale wrappers for other ICU functions such as u_isalpha() or u_isalnum(). How can I these use these ICU functions?

Thank you!


Solution

  • This will depend on how you're building Boost.Locale & linking against ICU. If for example you're linking against dynamic ICU libraries (e.g. Boost dll/so/dylib relies on ICU dll/so/dylib) or linking in ICU directly to satisfy the dependency, then you simply need to include the proper ICU header(s) and call the APIs.

    For example, u_isalpha() is found in uchar.h