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
+29.7k Golang : Get and Set User-Agent examples
+10k Golang : Check a web page existence with HEAD request example
+8.7k Golang : Heap sort example
+9.2k Golang : Apply Histogram Equalization to color images
+21.4k Golang : Encrypt and decrypt data with TripleDES
+14.4k How to automatically restart your crashed Golang server
+32.1k Golang : Math pow(the power of x^y) example
+15.8k Golang : Read a file line by line
+11.4k Golang : Handle API query by curl with Gorilla Queries example
+13.6k Generate salted password with OpenSSL example
+10.9k Golang : Create S3 bucket with official aws-sdk-go package
+7.4k Golang : How to stop user from directly running an executable file?