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
+10.1k Golang : Convert file content to Hex
+5.1k Python : Convert(cast) string to bytes example
+21.5k Golang : Convert string slice to struct and access with reflect example
+9.6k Golang : Turn string or text file into slice example
+11.3k Golang : Change date format to yyyy-mm-dd
+7.4k Javascript : Push notifications to browser with Push.js
+17.5k Golang : Iterate linked list example
+16k Golang : How to extract links from web page ?
+15.2k Golang : invalid character ',' looking for beginning of value
+4.1k Javascript : How to show different content with noscript?
+26.5k Golang : Find files by extension
+48.3k Golang : Upload file from web browser to server