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
+20.1k Golang : Upload big file (larger than 100MB) to AWS S3 with multipart upload
+5.6k Golang : How to setup a disk space used monitoring service with Telegram bot
+9.1k Golang : Text file editor (accept input from screen and save to file)
+5.7k Golang : Check if password length meet the requirement
+2k Golang : Fix go-cron set time not working issue
+18.5k Golang : Append content to a file
+9.1k Golang : Wait and sync.WaitGroup example
+3.9k Javascript : How to get width and height of a div?
+9.1k Golang : cannot assign type int to value (type uint8) in range error
+9.7k PHP : Convert(cast) bigInt to string
+11.7k Golang : http.Get example