Using ICU classes and methods from C #

I would like to use ICU classes and methods from a C # application, in particular for interrupt interpreters and related types. I assume I am using DllImport to refer to the ICU4C DLL, but I'm not sure how to pass types like ICU strings. Will .NET be for them? Are the libraries included in the COM binary distribution compatible?

+4
source share
2 answers

Take a look at ICU4NET :

ICU4NET provides binding for the .NET language through ICU4C.

It seems like this will be exactly what you need - if it works. Admittedly, the last β€œrelease” was 0.0.3, and the last change was in August 2010, but it would still be a useful starting point, I would suggest.

(You may find that it works until it disappears, but since it completed everything that the original author needed, as much as possible. If you could make changes to it as needed, it would benefit future developers in the same position ...)

+3
source

There seems to be an alternative: icu-dotnet

It looks like the Lucene.net team is changing from ICU4NET to icu-dotnet for the following reason :

Regarding ICU4NET, we have replaced ICU4NET with icu-dotnet ( https://github.com/sillsdev/icu-dotnet ). We decided to change the library because ICU4NET uses a small C ++ / CLI wrapper around the source library, but there are currently no plans to move C ++ / CLI to a cross platform. icu-dotnet uses PInvokes instead.

I was hoping they would leave ICU4NET as nuget packages are for x86 only.

+1
source

All Articles