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

Problem with charset of message part / DataPartInfo #475

Closed
felix-goecking opened this issue Sep 9, 2020 · 0 comments
Closed

Problem with charset of message part / DataPartInfo #475

felix-goecking opened this issue Sep 9, 2020 · 0 comments

Comments

@felix-goecking
Copy link

Hi,
we are having problems with chinese / hongkong mails and I'm wondering what the charset attribute in the DataPartInfo.php is used for. The problem is the following: We are receiving a mail with two parts, one of them is that:
`
--00000000000035bb5705ae7bcde0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64

5L2g5aW977yM5pyJ5pu05aSa6Zec5pa86Jaq6YWs6LOH5paZ5ZeO77yfDQoNCuOAjEhPIE1hcmt1
cyA8bWFya3VzaG8xMDMwQGdtYWlsLmNvbT7jgI3lnKggMjAyMOW5tDnmnIgz5pelIOmAseWbm++8
jDIxOjI4IOWvq+mBk++8mg0KDQo+IOS9oOWlve+8jOaIkeacg+eboeW/q+Whq+WlveS4puS4lOaK
iuihqOagvOS6pOWbnu+8jOS9huaIkeacieWAi+WVj+mhjOaYr+iWqumFrOWmguS9leioiOeul++8
nw0KPg0KPiBDbG91ZHdvcmtlcnMgQWdlbnRzIEhLIDxqb2JzLmhrQGNsb3Vkd29ya2Vycy5jb21w
YW55PiDmlrwgMjAyMOW5tDnmnIgz5pelIOmAseWbmw0KPiDkuIvljYg2OjQ45a+r6YGT77yaDQo+
DQo+Pg0KPj4NCj4+DQo+Pg0KPj4g5oKo5aW977yM5YaN5qyh5oSf6Kyd5oKo5bCH6KaB5rGC55qE
5paH5Lu26YCA6YKE57Wm5oiR5YCR44CCDQo+Pg0KPj4NCj4+DQo+Pg0KPj4g5L2G5piv77yM55Sx
5pa857y65bCR5YW25Lit55qE5paH5qqU77yM6KuL5YaN5qyh55m86YCB6YCZ5Lqb5paH5qqU77yM
5Lul5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Qo+Pg0KPj4NCj4+DQo+Pg0KPg0K
Pg0K
`

The charset is set to UTF-8 and the DataPartInfo.php recognizes that correctly. But in the method convertEncodingAfterFetch this charset isn't used anymore. Instead the method decodeMimeStr uses imap_mime_header_decode, which extracts the element and returns default as charset. But with barbushin/php-imap#513 I can override the "default", which I need to do since some of the chinese mails need to be converted. Thus the previous correct string is converted and is now corrupted. So why is the charset parameter of the DataPartInfo not used for encoding the message part? Or am I missing something?

Best regards
Felix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant