Skip to content

mathiasbaert/Unidecode.NET

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unicode.NET

Build status NuGet NuGet License MIT

Forked from unidecodesharpfork.

Support , ,

Purpose

It often happens that you have text data in Unicode, but you need to represent it in ASCII. For example when integrating with legacy code that doesn’t support Unicode, or for ease of entry of non-Roman names on a US keyboard, or when constructing ASCII machine identifiers from human-readable Unicode strings that should still be somewhat intelligible (a popular example of this is when making an URL slug from an article title).

Overview

Unidecode.NET is .NET library dll, written in C#. It provides string or char extension method Unidecode() that returns transliterated string. It supports huge amount of languages. And it's very easy to add your language if it's not supported already!

Installation

Unicode.NET published as NuGet package: https://www.nuget.org/packages/Unidecode.NET/

To install Unidecode.NET, run the following command in the Package Manager Console

Install-Package Unidecode.NET

#Example code

Take a look at the list of assertions:

Assert.AreEqual("Bei Jing ", "\u5317\u4EB0".Unidecode());
Assert.AreEqual("Rabota s kirillitsey", "Работа с кириллицей".Unidecode());
Assert.AreEqual("aeoeuoAeOeUO", "äöűőÄÖŨŐ".Unidecode());
Assert.AreEqual("Hello, World!", "Hello, World!".Unidecode());
Assert.AreEqual("'\"\r\n", "'\"\r\n".Unidecode());
Assert.AreEqual("CZSczs", "ČŽŠčžš".Unidecode());
Assert.AreEqual("a", "".Unidecode());
Assert.AreEqual("a", "α".Unidecode());
Assert.AreEqual("a", "а".Unidecode());
Assert.AreEqual("chateau", "ch\u00e2teau".Unidecode());
Assert.AreEqual("vinedos", "vi\u00f1edos".Unidecode());

About

ASCII transliterations of Unicode text

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%