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
+11.7k Golang : Tutorial on loading GOB and PEM files
+3.3k Golang : Customize scanner.Scanner to treat dash as part of identifier
+32k Golang : convert(cast) bytes to string
+11.8k Golang : How to login and logout with JWT example
+11.7k Golang : Strings comparison
+8.3k Golang : Select region of interest with mouse click and crop from image
+7.8k Golang : Print how to use flag for your application example
+5.6k Golang : Scanf function weird error in Windows
+9.1k Golang : Display a text file line by line with line number example
+18.1k Curl usage examples with Golang
+12.6k Golang : Get current time from the Internet time server(ntp) example