Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for convert charset name ks_c_5601-1987 to CP949 #165

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Message/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ public function getDecodedContent($keepUnseen = false)
if ($this->getType() === self::TYPE_TEXT
&& strtolower($this->getCharset()) != 'utf-8'
) {
$charset = $this->getCharset();
$charset = 'ks_c_5601-1987' == $charset ? 'CP949' : $charset;
$this->decodedContent = Transcoder::create()->transcode(
$this->decodedContent,
$this->getCharset()
$charset
);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected function decode($value)
$parts = imap_mime_header_decode($value);
foreach ($parts as $part) {
$charset = 'default' == $part->charset ? 'auto' : $part->charset;
$charset = 'ks_c_5601-1987' == $charset ? 'CP949' : $charset;
// imap_utf8 doesn't seem to work properly, so use Transcoder instead
$decoded .= Transcoder::create()->transcode($part->text, $charset);
}
Expand Down