Skip to content

This is a ICU sub project for iOS project integration.

Notifications You must be signed in to change notification settings

sunkehappy/icu-ios

Repository files navigation

icu-ios

This is a ICU sub project for iOS project integration. And the [ICU] version is 57.1.

How to use

  1. Clone this project.
  2. $ ./build.sh
  3. $ ./make_universal.sh
  4. Copy the include and all .a files under build-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;
}

Reduce size

If you care about the final app size, you may want to use this tool: ICU Data Library Customizer.

Thanks to

  1. How to build ICU so I can use it in an iPhone app?
  2. Kiwix
  3. Can I have Swift, Objective-C, C and C++ files in the same Xcode project?
  4. reduce icu data library size

About

This is a ICU sub project for iOS project integration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published