Skip to content

Commit

Permalink
中国語でエンコードされた日本語を正しくデコードできるようにした。特定のメーラーで英語メールに返信すると中国語エンコードになることがあるらしい
Browse files Browse the repository at this point in the history
  • Loading branch information
Takahiro Tsuzuku committed Oct 15, 2024
1 parent d53d88a commit b343522
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions overrides/webklex/php-imap/src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ public function convertEncoding($str, string $from = "ISO-8859-2", string $to =
if (strtolower($from) == 'iso-2022-jp'){
$from = 'iso-2022-jp-ms';
}
if (strtolower($from) == 'gb2312'){
$from = 'gb18030';
}

// Try iconv.
if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7' && $from != 'iso-2022-jp-ms') {
Expand Down

0 comments on commit b343522

Please sign in to comment.