[i18n] Enquiry on Chinese gb2312 and gbk encoding

George ccto george.ccto at gmail.com
Thu Jan 5 14:29:59 UTC 2017


Dear all,

GB2312 is a simplified Chinese encoding.
GBK is a super-set of GB2312 , and some traditional Chinese font.

Standard Horde (5.2.17) shows gb2312 (only simplified Chinese) perfectly.

However, It is quite common in Hong Kong users to receive email in
simplified Chinese (gb2312), and replied with traditional Chinese text.

If an email contains traditional Chinese text in gb2312, it cannot be
displayed inside Horde.

If I manually modify ../horde.pear/pear/php/Horde/String.php , and added
the highlighted code, it works fine for both simplified and traditional
Chinese in gb2312 encoding

*    protected static function _convertCharset($input, $from, $to)*
*    {*

*        if ( $from == "gb2312" ) $from = "gbk";*

*        /* Use utf8_[en|de]code() if possible and if the string isn't too*
*         * large (less than 16 MB = 16 * 1024 * 1024 = 16777216 bytes) -
these*
*         * functions use more memory. */*
*        if (Horde_Util::extensionExists('xml') &&*


May I ask is there any better way to do this? (e.g. via hook/config/...)?

Thank you very much for your kind attention

Regards
George


More information about the i18n mailing list