ICU4N 60.1.0-alpha.402
dotnet add package ICU4N --version 60.1.0-alpha.402
NuGet\Install-Package ICU4N -Version 60.1.0-alpha.402
<PackageReference Include="ICU4N" Version="60.1.0-alpha.402" />
paket add ICU4N --version 60.1.0-alpha.402
#r "nuget: ICU4N, 60.1.0-alpha.402"
// Install ICU4N as a Cake Addin #addin nuget:?package=ICU4N&version=60.1.0-alpha.402&prerelease // Install ICU4N as a Cake Tool #tool nuget:?package=ICU4N&version=60.1.0-alpha.402&prerelease
International Components for Unicode
ICU4N is a set of .NET libraries providing Unicode and Globalization support for software applications, a .NET port of the popular ICU4J project.
This is a port of ICU4J, version 60.1. We have ported about 50% of the code, and while we aren't planning to add any additional features it is still a work in progress.
Features
Here are some of the major features that have been ported:
- BreakIterator
- RuleBasedBreakIterator
- Normalizer
- Normalizer2
- FilteredNormalizer2
- UnicodeSet
- Collator
- RuleBasedCollator
- Transliterator
- RuleBasedTransliterator
- RuleBasedNumberFormat - only formatting from number > string is supported by calling members of the
ICU4N.Text.FormatNumberRuleBased
class or by using them as extension methods from System.Byte, System.Int16, System.Int32, System.Int64, System.Int128, System.Numerics.BigInteger, System.SByte, System.IntPtr, System.UInt16, System.UInt32, System.UInt64, System.UInt128, System.Half, System.Single, System.Double, or System.Decimal.
There are several other features too numerous to mention, but APIs are currently in flux between releases. We have over 4200 passing tests, most failures are just due to missing dependencies.
NuGet Packages
Install-Package ICU4N -Pre
The package structure is as follows:
- ICU4N (main package)
- ICU4N.Resources - See the documentation for Managing Resources
- ICU4N.Resources.NETFramework4.0 - See the documentation for Managing Resources
Documentation
We have converted most of the documentation comments so Visual Studio Intellisense works. However, for full API docs the best source at the moment is the ICU4J API Reference. There is also a lot of other great info on the ICU project's web site, such as the Feature Comparison Page.
Managing Resources
IMPORTANT: The version of resources that is used must be at the same version as ICU4N.
There are 2 ways to deploy resources with ICU4N.
Using Satellite Assemblies
This is the default and recommended way to use ICU4N resources. Using satellite assemblies to manage resources allows you to include/exclude specific cultures.
Using Resource Files
Using resource files allows you to finely tune the amount of data that is distributed with your project by including/excluding specific features as well as cultures.
NOTE: ICU4N does not shadow copy these files. It is not recommended to use resource files to deploy resources if you are using an "always up" service (such as ASP.NET) and intend to use xCopy deployment, since the resource files may be locked by your application when you try to overwrite them.
Default Satellite Assemblies
By default, ICU4N includes a transitive dependency on ICU4N.Resources, which includes satellite assemblies for all features and languages. For most projects, this should suffice.
It is recommended to use the default set of data for class libraries that are deployed via NuGet to be shared, and to only consider using custom subsets of data for executable projects. This gives every consumer of a shared library a chance to customize the ICU resource data.
NOTE: For SDK-Style projects that target
net40
ornet403
, the transitive dependency is on ICU4N.Resources.NETFramework4.0. This package contains exactly the same files as ICU4N.Resources and only exists to work around the fact that NuGet doesn't support a single target framework to deploy satellite assemblies to targets belownet45
as well as targets that supportnetstandard1.0
(which supportsnet45
and higher).
Custom Satellite Assemblies
ICU4N contains more than 750 cultures which use more than 20MB of disk space.
It is possible to reduce the distribution size by excluding cultures that you don't intend to support. To ship a subset of satellite assemblies, there are 2 options:
- Option 1: Re-package a Subset of Satellite Assemblies - Currently, there is no built-in support. The recommended way is to download the matching version of ICU4N.Resources, use a zip utility to unzip the package, and create a NuGet package with a custom name using the subset of satellite assemblies desired.
- Option 2: Change your build script to delete the
<culture name>/ICU4N.resources.dll
files after the build and before packing and/or publishing them.
The satellite assemblies are located in folders named like <culture name>/ICU4N.resources.dll
.
IMPORTANT: The neutral culture satellite assembly files contain shared resource data for all of the specific cultures. If you include one or more specific cultures, such as
fr-CA/ICU4N.resources.dll
, you must also include the neutral culturefr/ICU4N.resources.dll
.
IMPORTANT: There is a common satellite assembly named
ICU4N.resources.dll
that sits in the assembly directory. This file must always be included for ICU4N to function when using satellite assemblies.
When including custom resource data with ICU4N, be sure to exclude the transitive dependencies from ICU4N as described in Removing the default Transitive Dependency on ICU4N.Resources.
Custom Resource Files
Resource files can be used to reduce the total amount of resource data even further by excluding both features and cultures that are not being used. Resource files are automatically detected if they are in the <assembly_directory>/data/<icuversion>/<feature>
directory. The default set of resource files can be downloaded from Maven for the ICU4J version corresponding to this version of ICU4N. Simply download the main icu4j.jar
file. This file can be extracted with a Zip utility. The resource data can be found in the /com/ibm/icu/impl/data/
directory.
Reducing resource data is an advanced topic. See the ICU Data topic to decide the best approach for which resources to include.
Resources will be detected automatically if they are in the /data/
directory. Note that including the versioned subdirectory (such as icudt60b
) is required.
When including custom resource data with ICU4N, be sure to exclude the transitive dependencies from ICU4N as described in Removing the default Transitive Dependency on ICU4N.Resources.
Removing the default Transitive Dependency on ICU4N.Resources
To deploy custom resources via NuGet with your project, you must remove the transitive dependency on the ICU4N.Resources package so the full set of resources isn't accidentally deployed to projects that consume yours. This can be done using the ExcludeAssets flag called buildTransitive
.
<ItemGroup>
<PackageReference Include="ICU4N" Version="60.1.0-alpha.401" ExcludeAssets="buildTransitive" />
</ItemGroup>
Legacy Non-SDK-Style Projects
For projects that are using a .NET SDK lower than .NET 5.0 and/or are using a non-SDK style project (i.e. a project that specifies ToolsVersion="4.0" or lower in the <Project>
element) support for resources is not automatic. You must manually add a package reference to one of:
- Option 1: ICU4N.Resources
- Option 2: ICU4N.Resources.NETFramework4.0
- Option 3: A custom NuGet package with a subset of resources.
The ability for consuming projects to minimize resource files beyond the set of resources specified by the original package author for non-SDK style projects is not supported.
Building and Testing
To build the project from source, see the Building and Testing documentation.
Saying Thanks
If you find this library to be useful, please star us on GitHub and consider a sponsorship so we can continue bringing you great free tools like this one. It really would make a big difference!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 is compatible. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.0
- J2N (>= 2.0.0)
-
.NETFramework 4.5.1
- J2N (>= 2.0.0)
- Microsoft.Extensions.Caching.Memory (>= 1.1.2)
-
.NETStandard 2.0
- J2N (>= 2.0.0)
- Microsoft.Extensions.Caching.Memory (>= 2.0.0)
-
net6.0
- J2N (>= 2.0.0)
- Microsoft.Extensions.Caching.Memory (>= 6.0.0)
-
net7.0
- J2N (>= 2.0.0)
- Microsoft.Extensions.Caching.Memory (>= 6.0.0)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on ICU4N:
Package | Downloads |
---|---|
ICU4N.Transliterator
Transliteration support (phonetic conversion from one script to another) for ICU4N. ICU (International Components for Unicode) is a set of libraries providing Unicode and Globalization support for software applications. ICU4N is a .NET port of ICU4J. |
|
ICU4N.LanguageData
International language compiled resources for ICU4N. ICU (International Components for Unicode) is a set of libraries providing Unicode and Globalization support for software applications. ICU4N is a .NET port of ICU4J. |
|
ICU4N.CurrencyData
International currency compiled resources for ICU4N. ICU (International Components for Unicode) is a set of libraries providing Unicode and Globalization support for software applications. ICU4N is a .NET port of ICU4J. |
|
ICU4N.Collation
Rule-based collation support for ICU4N. ICU (International Components for Unicode) is a set of libraries providing Unicode and Globalization support for software applications. ICU4N is a .NET port of ICU4J. |
|
ICU4N.RegionData
International region compiled resources for ICU4N. ICU (International Components for Unicode) is a set of libraries providing Unicode and Globalization support for software applications. ICU4N is a .NET port of ICU4J. |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on ICU4N:
Repository | Stars |
---|---|
apache/lucenenet
Apache Lucene.NET
|
|
DigitalPlatform/dp2
Integrated Library System / 图书馆集成系统
|
Version | Downloads | Last updated |
---|---|---|
60.1.0-alpha.402 | 80,306 | 4/2/2023 |
60.1.0-alpha.401 | 164 | 3/4/2023 |
60.1.0-alpha.400 | 109 | 3/3/2023 |
60.1.0-alpha.356 | 198,260 | 1/15/2022 |
60.1.0-alpha.355 | 16,571 | 10/24/2021 |
60.1.0-alpha.354 | 199,868 | 3/11/2021 |
60.1.0-alpha.353 | 10,729 | 9/21/2020 |
60.1.0-alpha.352 | 1,149 | 7/28/2020 |
60.1.0-alpha.351 | 7,592 | 7/15/2020 |
60.1.0-alpha.350 | 8,724 | 6/25/2020 |
60.1.0-alpha.300 | 428 | 6/1/2020 |
60.1.0-alpha.238 | 31,626 | 4/10/2020 |
60.1.0-alpha.231 | 394 | 4/5/2020 |
60.1.0-alpha.225 | 30,936 | 3/13/2020 |
60.1.0-alpha.203 | 496 | 2/7/2020 |
60.1.0-alpha.197 | 428 | 1/23/2020 |
60.1.0-alpha.193 | 5,160 | 12/24/2019 |
60.1.0-alpha.192 | 471 | 12/13/2019 |
60.1.0-alpha.187 | 11,065 | 10/18/2019 |
60.1.0-alpha.53 | 32,503 | 8/9/2019 |
60.1.0-alpha.52 | 382 | 8/6/2019 |
60.1.0-alpha.46 | 537 | 7/27/2019 |
https://github.com/NightOwl888/ICU4N/releases/tag/v60.1.0-alpha.402
This is an early prerelease. Not all features are fully functional yet, and there may still be some gaps in functionality that haven't been accounted for. See https://github.com/NightOwl888/ICU4N for more info about what is functioning and what is not.