How to remove non-printable characters

Issue I’m trying to remove non-printable characters from a string in Golang. https://play.golang.org/p/Touihf5-hGH invisibleChars := “Douglas​” fmt.Println(invisibleChars) fmt.Println(len(invisibleChars)) normal := “Douglas” fmt.Println(normal) fmt.Println(len(normal)) Output: Douglas​ 10 Douglas 7 The first string has an invisible char at the end. I’ve tried

Continue reading

Remove diacritics using Go

Issue How can I remove all diacritics from the given UTF8 encoded string using Go? e.g. transform the string “žůžo” => “zuzo”. Is there a standard way? Solution You can use the libraries described in Text normalization in Go. Here’s

Continue reading