-
Notifications
You must be signed in to change notification settings - Fork 90
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
Received mail may be truncated or its body may become empty when creating ticket from mail #28
Comments
I used your second solution (mbstring) which worked fine until now. But I just got a mail with an utf-8 smiley and it truncated the message again. |
@cleiter I haven't tried emojis. What's your database charset? |
Everything is UTF-8. Pretty sure the problem is in PHP. I probably have to go with the iconv solution to fix this once and for all... Also see docker-library/php#240 |
So i tried that (built my own docker image) and actually it did not improve things. I investigated further and saw that the correct type in mysql is not utf8 but utf8mb4. I did a quick:
(the first thing removes and now I get Still not a perfect solution but hopefully it helps someone. |
@cleiter
Otherwise, it won't work. |
I did change the default encoding to utf8mb4 but that doesn't affect existing tables, hence the alter table query. How would I set the mysql encoding in PHP for osticket? |
OK thanks for your help :) I'll live with it as it is. For reference, this was indeed a 4 byte smiley: 😊 (f09f 988a) I would be super happy if the base image took care of all these encoding issues. |
Alpine's iconv don't have all the LUT preset; thus if osTicket received mails from these encodings (e.g. GB18030, which is still common in China Mainland), iconv conversion will fail, causing osTicket to treat source text as UTF-8 encoding, thus truncating anything after the first non-ASCII character.
Potential fix: either rebuild iconv with all the LUTs (I didn't try), or remove iconv support and use mbstring instead (I'm using this).
Note: in the develop branch of osTicket, the encoding function moved from
Charset::transcode()
toFormat::encode()
,so the patch I provided won't work with the next version.The text was updated successfully, but these errors were encountered: