Reputation: 13720
The following are the relevant raw headers downloaded via Thunderbird / Maildir:
X-Mailer: snPFB 81
Subject: [标题]Sword and Soul is online
Date: Thu, 04 Jul 2024 05:33:41 +0800
Content-Type: text/html;
charset="gbk"
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=
X-Spam-Score:
X-Spam-Bar:
X-Ham-Report:
X-Spam-Flag: NO
The gbk
character encoding is Simplified Chinese. No matter what I do the Chinese characters get converted by PHP's IMAP functions. A few examples:
$message_headers = imap_fetchheader($mail_connection_folder, $email_number);
$message_overview = imap_fetch_overview($mail_connection_folder, $email_number);
$message_raw_full = imap_fetchbody($mail_connection_folder, $email_number, '');
All three instances convert the Chinese characters to the string [БъЬт]
.
I'm guessing somehow PHP IMAP is making some sort of presumption about the character encoding. I've been going through trying other more RFC specific functions though the "gateway" functions all seem to impose some unknown character encoding that corrupts the original encoding. I just want to literally dump the raw header in to a flat file and I can't even do that.
Which of the PHP IMAP extension functions allow me to get the raw headers or at least allow me to set a parameter to return them using the provided character set?
Upvotes: 0
Views: 29