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

Smiles\emojis cause damage #232

Closed
commanddotcom opened this issue Mar 16, 2018 · 3 comments
Closed

Smiles\emojis cause damage #232

commanddotcom opened this issue Mar 16, 2018 · 3 comments
Labels
needs investigation This will be tested / debugged or checked out. phpunit Adding or updating PHPUnit tests for this issue.

Comments

@commanddotcom
Copy link
Contributor

commanddotcom commented Mar 16, 2018

I have email subject like:

 =?UTF-8?q?Some_subject_here_?= =?UTF-8?q?=F0=9F=98=98?=

This part =F0=9F=98=98 is a emoji and it will case error Mime string encoding conversion failed in method convertStringEncoding() which is called by decodeMimeStr()

@lincome
Copy link
Contributor

lincome commented Mar 21, 2018

Me too.
Does anyone know how to solve emoji problems.

@Sebbo94BY Sebbo94BY added needs investigation This will be tested / debugged or checked out. phpunit Adding or updating PHPUnit tests for this issue. labels May 3, 2019
Sebbo94BY pushed a commit that referenced this issue May 9, 2019
@Sebbo94BY
Copy link
Collaborator

I've added some PHPUnit tests - all is working fine as expected.

The problem is, that you need the server encoding US-ASCII with Microsoft Exchange servers and the function decodeMimeStr() uses the set server encoding.

So, if you use US-ASCII it can not convert emojis or any other UTF8 characters.

So we maybe should just decode such fields like subject with UTF8 - even when ASCII is defined?

Sebbo94BY pushed a commit that referenced this issue May 11, 2019
@Sebbo94BY
Copy link
Collaborator

Fixed with above referenced commit. Will be included in the next release.

Sebbo94BY added a commit that referenced this issue May 11, 2019
- Updated comments, made code a bit more dynamic, used setAttachmentsDir() in constructor
- Added condition for setting attachments dir in constructor
- Issue #232: Added test strings with emojis (smiles) to PHPUnit test
- Issue #232: Added strings to test decodeMimeStr() in PHPUnit test with non-UTF8 server encoding
- Issue #232: Fixed broken UTF-8 decoded strings, when not using UTF-8 as server encoding
- Issue #265: Added string to test iconv() in PHPUnit test
- Issue #274: Some strings with default charset had UTF-8 characters and failed to convert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation This will be tested / debugged or checked out. phpunit Adding or updating PHPUnit tests for this issue.
Projects
None yet
Development

No branches or pull requests

3 participants