Any PHP or Ruby library to convert Tranditional Chinese to Simplified Chinese or vice versa?

Is there a PHP or Ruby library to translate Tranditional Chinese to Simplified Chinese or vice versa (Big5 ↔ GB)? The iconv library won't do this as it just converts the encoding, but the glyph remains the same.

0


a source to share


2 answers


You can get some leverage with 1.9

Encoding.constants.grep / gb / i => [: GB18030 ,: GBK ,: GB1988 ,: GB12345]

     

Encoding.constants.grep / big5 / i => [: Big5 ,: BIG5 ,: Big5_HKSCS ,: BIG5_HKSCS ,: Big5_UAO ,: BIG5_UAO]

so something like

How can I convert a string from windows-1252 to utf-8 in Ruby?



original = File.open ('name', 'r: original_encoding'). read

original.force_encoding ('new_encoding')

Although I have never tried it.

+1


a source


Try this class for PHP - http://www.phpclasses.org/browse/package/3130.html



+2


a source







All Articles