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
+6.4k PHP : Proper way to get UTF-8 character or string length
+11.4k Golang : Delay or limit HTTP requests example
+21.7k Golang : Encrypt and decrypt data with TripleDES
+21.3k Golang : How to force compile or remove object files first before rebuild?
+11.6k Golang : Surveillance with web camera and OpenCV
+7.4k Golang : Accessing dataframe-go element by row, column and name example
+19.1k Golang : Clearing slice
+6.5k Golang : Handling image beyond OpenCV video capture boundary
+8.4k Useful methods to access blocked websites
+11k Golang : Create Temporary File
+42k Golang : How do I convert int to uint8?
+41.5k Golang : Convert string to array/slice