I found that messages from txt.att.net do not define their encoding. If the encoding is undefined, messages with "illegal" characters will be cut off. For example, "Mañana" becomes "Ma". Most e-mail clients are able to deal with undefined encodings and I suggest mailhandler should be able to as well, by using a sane default encoding.

Sample code to reproduce this issue: drupal_set_message(drupal_convert_to_utf8('Mañana', NULL));

This patch defines the default encoding as Windows-1252, which in my experience is the most common encoding for e-mail messages that do not define their encoding.

CommentFileSizeAuthor
#5 mailhandler-580810-5.patch2.13 KBIan Ward
encoding.patch803 bytesmfb

Comments

Ian Ward’s picture

@mfb what do you think allowing default/fallback encoding to be set per-mailbox?

mfb’s picture

I don't need such a setting myself but sure, if it's useful for someone :)

dariogcode’s picture

Awesome!!, I lost many time finding what I need do to fix it. Thanks!!!, may be this move to stable version?

Gracias!, supongo que el uso de la Ñ te hace de habla hispana o tienes clientes de habla hispana. Saludos!!

z.stolar’s picture

I'd use UTF-8 to encourage more people to use it as their default encoding, and if we set it, it should probably be configurable.

I'm not sure it should be a per-mailbox setting. It seem to me it would be more useful as a site-wide configuration, so if it needs to be changed, it should only be changed once (I don't expect anyone to change it more than once on a site)

Ian Ward’s picture

StatusFileSize
new2.13 KB

@z.stolar Agreed - site wide setting seems sufficient. What's the best way to offer this setting on the user interface? A textfield like in the attached patch, defaulted to UTF-8?

z.stolar’s picture

Yes, that seem like the right place to do it.

Ian Ward’s picture

Status: Needs review » Fixed

I applied the patch in #5 to 6.1. Will apply to 6.2 as well. Marking this as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.