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
+4.6k PHP : Hide PHP version information from curl
+6.5k Golang : Not able to grep log.Println() output
+8.6k Golang : Accessing content anonymously with Tor
+10.5k Golang : Byte format example
+26k Golang : Find files by name - cross platform example
+19.2k Golang : How to get struct tag and use field name to retrieve data?
+4.1k PHP : Extract part of a string starting from the middle
+26.1k Golang : Convert CSV data to JSON format and save to file
+6.3k Ubuntu : connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream
+10.3k Google Maps URL parameters configuration
+14.5k Golang : Get digits from integer before and after given position example