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
+13.4k Golang : Get constant name from value
+32.4k Golang : Math pow(the power of x^y) example
+19.2k Golang : Execute shell command
+10.6k Fix ERROR 1045 (28000): Access denied for user 'root'@'ip-address' (using password: YES)
+12k Golang : Convert a rune to unicode style string \u
+29.2k Golang : missing Git command
+14k Golang : Human readable time elapsed format such as 5 days ago
+17.9k Golang : Simple client server example
+6.3k Golang : How to get capacity of a slice or array?
+9.1k Golang : Serving HTTP and Websocket from different ports in a program example
+11.4k Golang : Fix fmt.Scanf() on Windows will scan input twice problem
+17.5k Golang : Find smallest number in array