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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | mailhandler-580810-5.patch | 2.13 KB | Ian Ward |
| encoding.patch | 803 bytes | mfb |
Comments
Comment #1
Ian Ward commented@mfb what do you think allowing default/fallback encoding to be set per-mailbox?
Comment #2
mfbI don't need such a setting myself but sure, if it's useful for someone :)
Comment #3
dariogcode commentedAwesome!!, 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!!
Comment #4
z.stolar commentedI'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)
Comment #5
Ian Ward commented@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?
Comment #6
z.stolar commentedYes, that seem like the right place to do it.
Comment #7
Ian Ward commentedI applied the patch in #5 to 6.1. Will apply to 6.2 as well. Marking this as fixed.