Skip to content

Regis24GmbH/go-diacritics

Repository files navigation

Build Status Github Tag

Coverage Status Maintainability

Go Report Card GoDoc License


go-diacritics

A package to handle diacritics

Provides a method to remove diacritical characters from any string and replace them with their ASCII representation.

It handles all cases where an unicode decomposition exists (e.g. ä and è) as well as all known latin cases without an unicode decomposition as listed below.

Usage

To get the lastest tagged version of package, execute:

go get gopkg.in/Regis24GmbH/go-diacritics.v2

To import this package, add the following line to your code:

import "gopkg.in/Regis24GmbH/go-diacritics.v2"

This is a code example:

func main() {
  noDiacrits := godiacritics.Normalize("än éᶍample")
  println(noDiacrits) // prints "an example"
}