Golang : Convert Chinese UTF8 characters to Pin Yin
Not really a tutorial, but putting this here in case I need to refer back again in future. Here is a list of Golang packages that can convert UTF8 Chinese characters into romanized characters or Pin Yin.
https://github.com/axgle/pinyin
and
https://github.com/mozillazg/go-pinyin
For the dictionary, see here https://github.com/mozillazg/go-pinyin/blob/master/pinyin_dict.go
Here is what these packages can do:
$ pinyin 中国人
zhōng guó rén
See also : Golang : How to print rune, unicode, utf-8 and non-ASCII CJK(Chinese/Japanese/Korean) characters?
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+11.9k Golang : Convert(cast) float to int
+7k Mac OSX : Find large files by size
+12.8k Golang : Get absolute path to binary for os.Exec function with exec.LookPath
+18.7k Golang : Aligning strings to right, left and center with fill example
+18.8k Golang : Send email with attachment
+20.8k Nginx + FastCGI + Go Setup.
+7k Golang : Experimental emojis or emoticons icons programming language
+7.5k Golang : How to iterate a slice without using for loop?
+8.8k Golang : Progress bar with ∎ character
+36.6k Golang : Convert date or time stamp from string to time.Time type
+6.7k Grep : How to grep for strings inside binary data
+13.8k Golang : Query string with space symbol %20 in between