All Projects → sillsdev → icu-dotnet

sillsdev / icu-dotnet

Licence: MIT License
C# wrapper for ICU4C

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to icu-dotnet

stringx
Drop-in replacements for base R string functions powered by stringi
Stars: ✭ 14 (-70.83%)
Mutual labels:  unicode, icu, icu4c
Icu4x
Solving i18n for client-side and resource-constrained environments.
Stars: ✭ 275 (+472.92%)
Mutual labels:  unicode, icu
Icu
The new home of the ICU project source code.
Stars: ✭ 1,011 (+2006.25%)
Mutual labels:  unicode, icu
icu-demos
sample apps for ICU (formerly icuapps)
Stars: ✭ 13 (-72.92%)
Mutual labels:  icu, icu4c
Tokenizer
Fast and customizable text tokenization library with BPE and SentencePiece support
Stars: ✭ 132 (+175%)
Mutual labels:  unicode, icu
icu-swift
Swift APIs for ICU
Stars: ✭ 23 (-52.08%)
Mutual labels:  unicode, icu
Stringi
THE String Processing Package for R (with ICU)
Stars: ✭ 204 (+325%)
Mutual labels:  unicode, icu
ICU4N
International Components for Unicode for .NET
Stars: ✭ 18 (-62.5%)
Mutual labels:  unicode, icu
Stringy
🉑 Stringy - A PHP string manipulation library with multibyte support, performance optimized
Stars: ✭ 135 (+181.25%)
Mutual labels:  unicode
NuGet.CatalogReader
NuGet v3 catalog reader
Stars: ✭ 34 (-29.17%)
Mutual labels:  nuget
dotnet-Svg.Contrib.Render
No description or website provided.
Stars: ✭ 21 (-56.25%)
Mutual labels:  nuget
sugartex
SugarTeX is a more readable LaTeX language extension and transcompiler to LaTeX. Fast Unicode autocomplete in Atom editor via https://github.com/kiwi0fruit/atom-sugartex-completions
Stars: ✭ 74 (+54.17%)
Mutual labels:  unicode
SciColorMaps
Custom .NET color maps (user-defined or imported from matplotlib) for scientific visualization
Stars: ✭ 26 (-45.83%)
Mutual labels:  nuget
Reactive.XAF
DevExpress XAF extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
Stars: ✭ 60 (+25%)
Mutual labels:  nuget
multilanguages
AKSoftware.Localization.MultiLanguages is a package for .NET developers allows them to easily build apps target multiple languages with just few lines of code
Stars: ✭ 54 (+12.5%)
Mutual labels:  nuget
couplet
Unicode code points support for Clojure
Stars: ✭ 21 (-56.25%)
Mutual labels:  unicode
intl-format
A wrapper library for PHP to format and internationalize values in messages like sprintf
Stars: ✭ 12 (-75%)
Mutual labels:  icu
gpprofile2017
Gpprof with unicode support and new features.
Stars: ✭ 60 (+25%)
Mutual labels:  unicode
2048-rs
Rust implementation of 2048 game
Stars: ✭ 15 (-68.75%)
Mutual labels:  unicode
DevOpsExamples
A repo to show you how to use a private NuGet feed, such as Telerik, to restore packages in Azure DevOps, GitHub Actions, GitLab CI and AppCenter.
Stars: ✭ 16 (-66.67%)
Mutual labels:  nuget

Overview

icu-dotnet is the C# wrapper for a subset of ICU.

ICU is a mature, widely used set of C/C++ and Java libraries providing Unicode and Globalization support for software applications. ICU is widely portable and gives applications the same results on all platforms and between C/C++ and Java software.

Status

Build status

Usage

This library provides .NET classes and methods for (a subset of) the ICU C API. Please refer to the ICU API documentation. In icu.net you'll find classes that correspond to the C++ classes of ICU4C.

Although not strictly required it is recommended to call Icu.Wrapper.Init() at the start of the application. This will allow to use icu.net from multiple threads (c.f. ICU Initialization and Termination). Similarly, it might be beneficial to call Icu.Wrapper.Cleanup() before exiting.

Sample code:

	static class Program
	{
		public static void Main(string[] args)
		{
			Icu.Wrapper.Init();
			// Will output "NFC form of XA\u0308bc is XÄbc"
			Console.WriteLine($"NFC form of XA\\u0308bc is {Icu.Normalizer.Normalize("XA\u0308bc",
				Icu.Normalizer.UNormalizationMode.UNORM_NFC)}");
			Icu.Wrapper.Cleanup();
		}
	}

Building

icu-dotnet can be built with Visual Studio or MonoDevelop, but at least initially it might be easier to build from the command line because that will download all necessary dependencies.

Linux

You can build and run the unit tests by running:

build/TestBuild.sh

If you run into issues you might want to try with a newer mono version or with our custom mono-sil package from packages.sil.org

Docker

icu-dotnet depends on libc dynamic libraries at run time. If running within Docker, you may need to install them, for example:

FROM mcr.microsoft.com/dotnet/aspnet:3.1

# Install system dependencies.
RUN apt-get update \
    && apt-get install -y \
        # icu.net dependency: libdl.so
        libc6-dev \
     && rm -rf /var/lib/apt/lists/*

...

Windows

Build and run the unit tests by running:

msbuild /t:Test build/icu-dotnet.proj

ICU versions

Linux

icu-dotnet links with any installed version of ICU shared objects. It is recommended to install the version provided by the distribution. As of 2016, Ubuntu Trusty uses version ICU 52 and Ubuntu Xenial 55.

Windows

Rather than using the full version of ICU (which can be ~25 MB), a custom minimum build can be used. It can be installed by the Icu4c.Win.Min nuget package. The full version of ICU is also available as Icu4c.Win.Full.Lib and Icu4c.Win.Full.Bin.

What's in the minimum build

  • Characters
  • ErrorCodes
  • Locale
  • Normalizer
  • Rules-based Collator
  • Unicode set to pattern conversions

Troubleshooting

  • make sure you added the nuget packages icu.net and Icu4c.Win.Min (or Icu4c.Win.Full).
  • the binaries of the nuget packages need to be copied to your output directory. For icu.net this happens by the assembly reference that the package adds to your project. The binaries of Icu4c.Win.Min are only relevant on Windows. They will get copied by the Icu4c.Win.Min.targets file included in the nuget package.

The package installer should have added an import to the *.csproj file similar to the following:

<Import Project="..\..\packages\Icu4c.Win.Min.54.1.31\build\Icu4c.Win.Min.targets"
	Condition="Exists('..\..\packages\Icu4c.Win.Min.54.1.31\build\Icu4c.Win.Min.targets')" />

Contributing

We love contributions! The library mainly contains the functionality we need for our products. If you miss something that is part of ICU4C but not yet wrapped in icu.net, add it and create a pull request.

If you find a bug - create an issue on GitHub, then preferably fix it and create a pull request!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].