ChinesePinyin 是一个用来将汉字转成拼音的Rails插件。
示例代码:[code]require 'rubygems'
require 'chinese_pinyin'
Pinyin.t('中国') => "zhong guo"
Pinyin.t('中国', '-') => "zhong-guo"
Pinyin.t('中国', '') => "zhongguo"
Pinyin.t('你好world') => "ni hao world"[/code]主页:https://github.com/flyerhzm/chinese_pinyin
下载:https://github.com/flyerhzm/chinese_pinyin/tags
来自:开源中国社区