Typing Hanyu Pinyin (Chinese Romanization)
Wednesday, September 1, 2010 at 8:36PM
One Hour Programmer

Hi guys,

Some of you guys have asked me to make a Mandarin Chinese version of Spanish_Accents_CapsLock. I’d be happy to, but someone’s already made a really clever little script for that. I really like his implementation, which is very specific to how hanyu pinyin and Chinese works. You just add the tone number right after the word. So you could type “zhong1guo2 shi4 shi4jie4 zui4 hao3 de guo2jia1” and you get “zhōngguó shì shìjiè zuì hǎo de guójiā”. To Chinese speakers this is very intuitive and much better than trying to come up with 4 different hotkeys for each vowel to account for each tone in Chinese.

The only thing that gives me pause in recommending it is that it’s an online solution. While the author’s kept the site running for years, I’m always wary of sites suddenly disappearing from the web. The author provides a download to the PHP script but in order to use it, you’d have to upload it to a server, but most people don’t have access to a spare server. For these people, I’ve made an offline version which CAN be run locally using any old browser. You can find the zip file here. Extract it and open “index.html” in your browser.

All credit goes to to Konrad M. Lawson, who wrote the app, and those who helped him: James Dew, Helmer Aslaksen, C.P. Sobelman, and Phyllis Zhang.

Article originally appeared on One Hour Programming - Programming for the Rest of Us (http://www.onehourprogramming.com/).
See website for complete article licensing information.