How to use ICU C++ API on macOS

2022-08-12T23:57:30

I would like to use ICU's C++ API, specifically the UnicodeString class, in a macOS app. I see that I can include headers for the C API from Xcode, but I don't see headers for the C++ API.

% PLAT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
% ls $PLAT/Developer/SDKs/MacOSX.sdk/usr/include/unicode
localpointer.h      ptypes.h        ...     ustring.h        
... other C API headers ...

But unistr.h and other C++ headers are not there. The unistr.h file declares the UnicodeString class.

However, if I look at this library file, it seems the library does contain the class.

% c++filt < $PLAT/Developer/SDKs/MacOSX.sdk/usr/lib/libicucore.A.tbd | grep icu::UnicodeString
...
icu::UnicodeString::UnicodeString(char16_t const*),  
icu::UnicodeString::UnicodeString(char16_t const*, int), 
icu::UnicodeString::UnicodeString(char const*),  
...

Anyone using C++ ICU for a macOS app? How do you do it?

Copyright License:
Author:「Rob N」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/73336852/how-to-use-icu-c-api-on-macos

About “How to use ICU C++ API on macOS” questions

I'm trying to use ICU4C on windows. I copied the 2 dlls into the executable directory and a ICU data file. According to what I read in the documentation, I should not need to set a specific data
there is one "icu4c" project at android platform (external/icu4u) any one know how to use this in my android application? I want to do some conversion, ec. unicode->big5, ...?
I'm looking into using ICU for Unicode string processing in a native Node.js module because it seems to me that v8::String (according to these docs) doesn't have a C++ API for this purpose. To my
I need to handle unicode strings in C. I have heard that ICU is the appropriate set of libraries to use but I am not having any luck getting started. So my question: Can anyone provide a link to a...
I'd like to use ICU classes and methods from within a C# application - specifically the break interators and associated types. My guess is that I use DllImport to reference the ICU4C dll's but I'm ...
I'm interested in ICU's internationalization and I wanna see if it's OK to integrate it with a C project. I've read the documentation in its website (localizing1) (resource management2). And I fo...
I would like to use ICU's C++ API, specifically the UnicodeString class, in a macOS app. I see that I can include headers for the C API from Xcode, but I don't see headers for the C++ API. % PLAT=/
hi I modified my sql statement as CREATE VIRTUAL TABLE [v_fts] USING fts4 ( [title], tokenize=icu )" But when I am trying to insert data I am getting error SQL logic error or missing database
I would like to use the CalendarAstronomer class from ICU to calculate the sunset/sunrise values for a given location. The API is good and clean, but the necessary file astro.h is not installed.
I have a byte[] array and I have to convert it to "Unicode, UnicodeWithBOM e.t.c" I tried ICU library but unable to find any solution. is there any functions available in ICU for java to

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.