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

Inappropriate converting of umlauts in subject #2965

Closed
sofl88 opened this issue May 2, 2023 · 7 comments
Closed

Inappropriate converting of umlauts in subject #2965

sofl88 opened this issue May 2, 2023 · 7 comments

Comments

@sofl88
Copy link

sofl88 commented May 2, 2023

Hello.

We got a strange behaviour reported when someone is trying to copy the subject of a conversation/email (Schadensmeldung FÜ230414439), paste it somewhere else inside the browser (atleast in latest chrome) and try to delete (backspace) the character Ü, which gets not deleted but instead, turns into an U.

The header information seems to be correct

Subject: =?UTF-8?Q?Schadensmeldung_F=C3=9C230414439?=

The website https://unicodelookup.com/ reveals that the Ü is some sort of a combined character (?)

combined Ü

image

manual typed Ü

image

This is a problem for us since we sometimes use the subject (or parts of it) to compare or search things in our database where things usually correct encoded/converted.

Thanks in advance.

@freescout-helpdesk
Copy link
Contributor

Are you using modern Microsoft OAuth IMAP authentication or APP_NEW_FETCHING_LIBRARY env variable?

@sofl88
Copy link
Author

sofl88 commented May 2, 2023

No to both.

@freescout-helpdesk
Copy link
Contributor

Try to add the following to .env file and clear cache:

APP_NEW_FETCHING_LIBRARY=true

@sofl88
Copy link
Author

sofl88 commented May 2, 2023

I tried but the issue is still there

@sofl88
Copy link
Author

sofl88 commented May 3, 2023

Reproducible in the freescout demo if that helps

@sofl88
Copy link
Author

sofl88 commented May 3, 2023

It seems the falsy conversion takes place here

https://github.com/freescout-helpdesk/freescout/blob/2fe0f518be3bf29a3677257b19fa482ea7d17d8c/overrides/webklex/laravel-imap/src/IMAP/Message.php#L330

The issue is gone when I change this line to

$this->subject = iconv_mime_decode($header->subject, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');

But I don't know if this is a suitable solution in general.

@freescout-helpdesk
Copy link
Contributor

Now iconv_mime_decode() function will be used for UTF-8 encoded subjects.

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

2 participants