mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:30:12 +01:00
[gui] Fixed mime handling of gb2312 encoding
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
e1ea14374a
commit
a69db4b61f
@ -205,6 +205,8 @@ class Piler_Mime_Decode {
|
|||||||
for($i=0; $i<count(self::HEADER_FIELDS); $i++) {
|
for($i=0; $i<count(self::HEADER_FIELDS); $i++) {
|
||||||
if(!isset($headers[self::HEADER_FIELDS[$i]])) { $headers[self::HEADER_FIELDS[$i]] = ''; }
|
if(!isset($headers[self::HEADER_FIELDS[$i]])) { $headers[self::HEADER_FIELDS[$i]] = ''; }
|
||||||
|
|
||||||
|
$headers[self::HEADER_FIELDS[$i]] = preg_replace("/gb2312/i", "GBK", $headers[self::HEADER_FIELDS[$i]]);
|
||||||
|
|
||||||
$headers[self::HEADER_FIELDS[$i]] = iconv_mime_decode($headers[self::HEADER_FIELDS[$i]], ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
|
$headers[self::HEADER_FIELDS[$i]] = iconv_mime_decode($headers[self::HEADER_FIELDS[$i]], ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,6 +327,9 @@ class Piler_Mime_Decode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isset($headers['content-type']['charset'])) {
|
if(isset($headers['content-type']['charset'])) {
|
||||||
|
if($headers['content-type']['charset'] == 'gb2312') {
|
||||||
|
$headers['content-type']['charset'] = 'GBK';
|
||||||
|
}
|
||||||
$body = iconv($headers['content-type']['charset'], 'utf-8' . '//IGNORE', $body);
|
$body = iconv($headers['content-type']['charset'], 'utf-8' . '//IGNORE', $body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user