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
+30.5k Golang : Copy directory - including sub-directories and files
+5.1k Golang : Extract XML attribute data with attr field tag example
+32.8k Golang : How to stream file to client(browser) or write to http.ResponseWriter?
+5.3k Golang : Map within a map example
+4.8k Golang : Error handling methods
+6.4k Golang : Get YouTube playlist
+8.4k Golang : Qt get screen resolution and display on center example
+18.2k Golang : How to Set or Add Header http.ResponseWriter?
+7.3k Golang : How to check variable or object type during runtime?
+12.6k Golang : Gin framework accept query string by post request example
+11.6k Golang : Pass database connection to function called from another package and HTTP Handler
+7.2k Golang : Metaprogramming example of wrapping a function