Opened 6 years ago
Closed 6 years ago
#1484597 closed Bugs (invalid)
UTF-8 content with content type ISO-8859 not handled
| Reported by: | gabtoth | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | |
| Component: | IMAP connection | Version: | 0.1-rc1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
In a multipart mail message (text + HTML) when the content type is ISO-8859-*, but the content of the part is actually UTF-8, then replying or forwarding the message display garbage characters (UTF-8 will be encoded in UTF-8)
Change History (2)
comment:1 Changed 6 years ago by gabtoth
comment:2 Changed 6 years ago by thomasb
- Resolution set to invalid
- Status changed from new to closed
If the message specifies a wrong charset it's not a RoundCube bug when that message is not handled correctly. The fix you suggest checks for a BOM which is not necessarily existent in an UTF-8 coded string.
Note: See
TracTickets for help on using
tickets.

Solution:
File main.inc, function rcube_charset_convert: check for bad content type
+ if ( from != "UTF-8" && bin2hex(substr($str,0,3)) == "efbbbf") {
+ already UTF-8, $from coding is bad
+ return $str;
+ }