Opened 5 years ago
Closed 4 years ago
#6788 closed defect (bug) (fixed)
wp-mail.php utf8 (umlauts)
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.7 |
| Component: | General | Version: | 2.5 |
| Severity: | blocker | Keywords: | utf8, wp-mail.php, deutsch, umlaut, has-patch, needs-testing |
| Cc: | westi |
Description
Wordpress version 2.5 wp-mail.php trims post-by-email content body at german umlauts. We can fix this by adding utf8_decode to wp-mail.php
Line 154
$content = utf8_encode($content);
That's all, folks.
Attachments (3)
Change History (18)
comment:1
revolution48 — 5 years ago
A more general solution would be nicer, this one only works for ISO-8859-1 to UTF-8 conversion.
Most German Email programs use ISO-8859-1 by default, but since Wordpress does not have only have German users...
You proposed patch would break if UTF-8 encoding was used, for example.
I will try to find a nice, general solution using the iconv-Library.
For the subject I have done it by now:
Line 64:
old:
$subject = wp_iso_descrambler($subject);
new:
$subject = iconv_mime_decode($subject,2,'utf8');
(why reinvent the wheel?) - works like a charm with utf8 AND ISO-8859-1 subjects.
I will come back later and try to present a solution for the email body.
- Keywords has-patch needs-testing added
added has-patch and needs-testing flags
comment:5
revolution48 — 5 years ago
Laenny's patch works fine if we also decode the body content. To do this add:
Line 76
$content = quoted_printable_decode($content);
Why is this moved time and time again? The Swedish community starting to get annoyed by this. Should be patched for 2.7. This is an easy one to patch!
iconv isn't always available so we'll probably need some function_exists checks.
comment:10
follow-up:
↓ 11
westi — 5 years ago
- Cc westi added
- Milestone changed from 2.7 to 2.8
Moved to 2.8 for now.
Patch very welcome but we need to ensure we cope with all mail encodings and don't break different ones instead.
comment:11
in reply to:
↑ 10
DaMsT — 5 years ago
Replying to westi:
Moved to 2.8 for now.
Patch very welcome but we need to ensure we cope with all mail encodings and don't break different ones instead.
You have to be freaking kidding med >:
comment:12
DaMsT — 5 years ago
- Severity changed from major to blocker
comment:13
filosofo — 4 years ago
Patch wp-mail.iconv.diff seems to handle the character encoding issues in my tests.
comment:14
westi — 4 years ago
- Milestone changed from 2.8 to 2.7
Patch looks good.
Rolling this into 2.7 :-)
comment:15
westi — 4 years ago
- Resolution set to fixed
- Status changed from new to closed

Problem:
Wordpress version 2.5 wp-mail.php cuts off subjects and content containing german umlauts.
Solution:
We can fix this by adding utf8_decode to wp-mail.php
Add this code:
Line 65
$subject = utf8_encode($subject);
Line 154
$content = utf8_encode($content);
Status:
a FORUM entry has been made here http://wordpress.org/support/topic/170583