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 : Setting variable value with ldflags
+7.2k Golang : Squaring elements in array
+6.1k Linux/MacOSX : Search for files by filename and extension with find command
+12.3k Golang : Pagination with go-paginator configuration example
+6.6k PHP : Shuffle to display different content or advertisement
+14.7k Golang : How to check if your program is running in a terminal
+14k Golang : convert(cast) string to float value
+4.9k Which content-type(MIME type) to use for JSON data
+9.9k Golang : Format strings to SEO friendly URL example
+11.7k SSL : The certificate is not trusted because no issuer chain was provided
+11.8k Golang : Find age or leap age from date of birth example
+14.7k Golang : Overwrite previous output with count down timer