{"id":13340143,"url":"https://github.com/apotocki/icu4c-iosx","last_synced_at":"2026-01-16T17:32:35.235Z","repository":{"id":44146942,"uuid":"324399578","full_name":"apotocki/icu4c-iosx","owner":"apotocki","description":"Builds ICU static libraries and packages them as XCFrameworks for iOS (simulator and device), visionOS (simulator and device), macOS, and Mac Catalyst (Intel \u0026 Apple Silicon M1).","archived":false,"fork":false,"pushed_at":"2024-05-03T21:25:27.000Z","size":92,"stargazers_count":35,"open_issues_count":1,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-03T23:33:53.439Z","etag":null,"topics":["icu4c","ios","ios-simulator","mac-catalyst","macosx","visionos","visionos-simulator","xcframework"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apotocki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"apotocki"}},"created_at":"2020-12-25T16:52:41.000Z","updated_at":"2024-07-29T23:00:40.023Z","dependencies_parsed_at":"2024-07-29T23:00:24.254Z","dependency_job_id":null,"html_url":"https://github.com/apotocki/icu4c-iosx","commit_stats":{"total_commits":47,"total_committers":4,"mean_commits":11.75,"dds":0.6382978723404256,"last_synced_commit":"4007e1d7fb7c49df110eb1571c1e72244d6e6c7a"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotocki%2Ficu4c-iosx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotocki%2Ficu4c-iosx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotocki%2Ficu4c-iosx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotocki%2Ficu4c-iosx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apotocki","download_url":"https://codeload.github.com/apotocki/icu4c-iosx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243070489,"owners_count":20231464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["icu4c","ios","ios-simulator","mac-catalyst","macosx","visionos","visionos-simulator","xcframework"],"created_at":"2024-07-29T19:22:08.127Z","updated_at":"2026-01-16T17:32:35.229Z","avatar_url":"https://github.com/apotocki.png","language":"Shell","funding_links":["https://github.com/sponsors/apotocki"],"categories":[],"sub_categories":[],"readme":"## ICU for iOS, watchOS, tvOS, visionOS, macOS, Mac Catalyst, and Simulators - Intel(x86_64) / Apple Silicon(arm64)\n\nThis repository provides a universal build script for creating **static ICU libraries** for iOS, watchOS, tvOS, visionOS, macOS, and Mac Catalyst.\n\nThe ICU source code is taken from the official Unicode ICU repository:\nhttps://github.com/unicode-org/icu\n\nRepository branches generally correspond to ICU maintenance branches. For example, the `78` branch corresponds to the `maint/maint-78` branch in the ICU repository.\n\n### Supported ICU Versions\n\n- [78.2](https://github.com/apotocki/icu4c-iosx/tree/78.2.0)\n- [78.1](https://github.com/apotocki/icu4c-iosx/tree/78.1.2)\n- [77.1](https://github.com/apotocki/icu4c-iosx/tree/77.1.1)\n- [76.1](https://github.com/apotocki/icu4c-iosx/tree/76.1.5)\n- [75.1](https://github.com/apotocki/icu4c-iosx/tree/75.1.4)\n- [74.2](https://github.com/apotocki/icu4c-iosx/tree/74.2.9)\n- [74.1](https://github.com/apotocki/icu4c-iosx/tree/74.1.0)\n- [73.2](https://github.com/apotocki/icu4c-iosx/tree/73.2.2)\n- [73.1](https://github.com/apotocki/icu4c-iosx/tree/73.1.0)\n- [72.1](https://github.com/apotocki/icu4c-iosx/tree/72.1.2)\n- [71.1](https://github.com/apotocki/icu4c-iosx/tree/71.1.6)\n- [70.1](https://github.com/apotocki/icu4c-iosx/tree/70.1.2)\n- [69.1](https://github.com/apotocki/icu4c-iosx/tree/69.1.3)\n- [68.2](https://github.com/apotocki/icu4c-iosx/tree/68.2.1)\n- [62.2](https://github.com/apotocki/icu4c-iosx/tree/62.2.1)\n\n---\n\n## Prerequisites\n\n1. **Xcode** must be installed, as `xcodebuild` is used to create XCFrameworks.\n2. `xcode-select -p` must point to the Xcode developer directory (for example, `/Applications/Xcode.app/Contents/Developer`).\n\n    If it points to the CommandLineTools directory, run one of the following commands:\n    ```bash\n    sudo xcode-select --reset\n    # or\n    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer\n    ```\n  \n---\n\n## Build Manually\n\n```bash\n# Clone the repository\ngit clone https://github.com/apotocki/icu4c-iosx\n    \n# Build libraries\ncd icu4c-iosx\nscripts/build.sh\n```\n\nThe resulting artifacts will be located in the `product` directory.\n\n---\n\n## Selecting Platforms and Architectures\n\nRunning `build.sh` without arguments builds XCFrameworks for **iOS** and **macOS**, and also for **watchOS**, **tvOS**, and **visionOS** if their SDKs are installed. Simulator XCFrameworks are built for the current host architecture (`arm64` or `x86_64`).\n\nTo build a specific set of platforms or architectures, use the `-p` option:\n\n```bash\nscripts/build.sh -p=ios,iossim-x86_64\n# Builds XCFrameworks only for iOS and the iOS Simulator (x86_64)\n```\n\n### Available `-p` Values\n\n```text\nmacosx,macosx-arm64,macosx-x86_64,macosx-both,\nios,iossim,iossim-arm64,iossim-x86_64,iossim-both,\ncatalyst,catalyst-arm64,catalyst-x86_64,catalyst-both,\nxros,xrossim,xrossim-arm64,xrossim-x86_64,xrossim-both,\ntvos,tvossim,tvossim-arm64,tvossim-x86_64,tvossim-both,\nwatchos,watchossim,watchossim-arm64,watchossim-x86_64,watchossim-both\n```\n\n- The `-both` suffix builds XCFrameworks for both `arm64` and `x86_64`.\n- Platform names without an architecture suffix (for example, `macosx`, `iossim`) build only for the current host architecture.\n\n---\n\n## ICU Data Archive\n\nThe `build.sh` script builds the following XCFrameworks:\n\n- `icudata`\n- `icui18n`\n- `icuio`\n- `icuuc`\n\nBy default, `icudata` is built with `--with-data-packaging=static` (see the ICU data documentation). All ICU metadata (locales, tables, rules, etc.) is embedded directly into the `icudata` library, making it relatively large (~32 MB).\n\nBecause an XCFramework may include multiple platforms and architectures, this metadata is duplicated several times, increasing the overall size. ICU allows this data to be moved into a separate, platform-independent archive that is loaded at runtime.\n\nTo enable this option, use `-d=archive`:\n\n```bash\nscripts/build.sh -p=ios,iossim-x86_64 -d=archive\n# Builds XCFrameworks for iOS and the iOS Simulator (x86_64)\n# Data file path: product/share/icu/78.2/icudt78l.dat\n```\n\nDuring ICU initialization, you must specify the ICU data directory **before** calling `u_init()`:\n\n```c\n#include \u003cunicode/putil.h\u003e\n#include \u003cunicode/uclean.h\u003e\n\n// Specify the directory containing the ICU data file\nu_setDataDirectory(\"PATH_TO_DIRECTORY_CONTAINING_icudt78l.dat\");\n\nUErrorCode errCode = U_ZERO_ERROR;\nu_init(\u0026errCode);\nif (U_FAILURE(errCode)) {\n    // Handle initialization error\n    ...\n}\n\n// Use ICU API...\n\nu_cleanup();  // Optional: release ICU resources\n\n```\n\n---\n\n## ICU Data Filtering\n\nICU metadata includes a large collection of locales, tables, and rules. In most applications, only a subset of this data is required.\n\nYou can reduce the size of `icudata` by applying a data filter using the `-f` option:\n\n```bash\nscripts/build.sh -p=ios,iossim-x86_64 -f=path_to_filter.json\n# Builds XCFrameworks for iOS and the iOS Simulator (x86_64)\n```\n\nThe filter format is described in the official ICU documentation:\nhttps://unicode-org.github.io/icu/userguide/icu_data/buildtool.html\n\n---\n\n## Rebuild Option\n\nTo rebuild the libraries without using artifacts from previous builds, use the `--rebuild` option:\n\n```bash\nscripts/build.sh -p=ios,iossim-x86_64 --rebuild\n```\n\n---\n\n## Build Using CocoaPods\n\nAdd the following to your `Podfile`:\n\n```ruby\nuse_frameworks!\npod 'icu4c-iosx'\n    \n# Or explicitly reference the repository\n# pod 'icu4c-iosx', :git =\u003e 'https://github.com/apotocki/icu4c-iosx'\n```\n\nInstall the dependency:\n\n```bash\n   pod install --verbose\n```\n\n---\n\n## Used in Production\n\nThe ICU libraries built by this project are used in my iOS application available on the App Store:\n\n[\u003ctable align=\"center\" border=0 cellspacing=0 cellpadding=0\u003e\u003ctr\u003e\u003ctd\u003e\u003cimg src=\"https://is4-ssl.mzstatic.com/image/thumb/Purple112/v4/78/d6/f8/78d6f802-78f6-267a-8018-751111f52c10/AppIcon-0-1x_U007emarketing-0-10-0-85-220.png/460x0w.webp\" width=\"70\"/\u003e\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://apps.apple.com/us/app/potohex/id1620963302\"\u003ePotoHEX\u003c/a\u003e\u003cbr\u003eHEX File Viewer \u0026 Editor\u003c/td\u003e\u003ctr\u003e\u003c/table\u003e]()\n\nPotoHEX is designed for viewing and editing files at the byte or character level, calculating hashes, encoding/decoding data, and compressing/decompressing selected byte ranges.\n\nIf you find this project useful, you can support my open-source work by trying the [App](https://apps.apple.com/us/app/potohex/id1620963302).\n\n---\n\nFeedback is welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapotocki%2Ficu4c-iosx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapotocki%2Ficu4c-iosx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapotocki%2Ficu4c-iosx/lists"}