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
+8k Golang : Check from web if Go application is running or not
+8.8k Golang : Sort lines of text example
+5.3k Golang : Pad file extension automagically
+5.8k Golang : Launching your executable inside a console under Linux
+9.8k Golang : Function wrapper that takes arguments and return result example
+22.1k Golang : Repeat a character by multiple of x factor
+11.7k Golang : Verify Linux user password again before executing a program example
+8.9k Golang : Inject/embed Javascript before sending out to browser example
+5.5k Python : Print unicode escape characters and string
+30.8k Golang : Interpolating or substituting variables in string examples
+11.4k Golang : Concatenate (combine) buffer data example
+15.1k Golang : How to add color to string?