From 23754febd0c32c562e871864dbce8d66a06f1e70 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 29 Apr 2015 13:53:48 -0500 Subject: [PATCH] i18n: Translate gb2312 to gbk charset This is necessary for some mail clients which indicate encoding in GB2312 but actually use GBK encoding. --- include/class.charset.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/class.charset.php b/include/class.charset.php index aa26cb2cc..d33c3abd1 100644 --- a/include/class.charset.php +++ b/include/class.charset.php @@ -31,6 +31,9 @@ class Charset { return 'cp949'; case preg_match('`^iso-?(\S+)$`i', $charset, $match): return "ISO-".$match[1]; + // GBK superceded gb2312 and is backward compatible + case preg_match('`^gb2312`i', $charset): + return 'GBK'; // Incorrect, bogus, ambiguous or empty charsets // ISO-8859-1 is assumed case preg_match('`^(default|x-user-defined|iso|us-ascii)$`i', $charset): -- GitLab