This is a ICU sub project for iOS project integration. And the [ICU] version is 57.1.
- Clone this project.
- $ ./build.sh
- $ ./make_universal.sh
- Copy the
include
and all.a
files underbuild-universal
to your project.
Why I don't use CocoaPods? Because the build will take a long time so we should not build it more than 1 time.
An example:
const char* IcuTool::format(string input, Formattable *argument, int argumentCount) {
UErrorCode errorCode = U_ZERO_ERROR;
MessageFormat form(input.c_str(), errorCode);
UnicodeString string;
FieldPosition fpos = 0;
form.format(argument, argumentCount, string, fpos, errorCode );
int32_t sz = (int32_t)input.length() * 2;
char* dest = new char[sizeof (*dest) * sz];
string.extract(dest, sz, NULL, errorCode);
return dest;
}
If you care about the final app size, you may want to use this tool: ICU Data Library Customizer.