Ticket #6788 (new defect)

Opened 3 months ago

Last modified 2 months ago

wp-mail.php utf8 (umlauts)

Reported by: revolution48 Assigned to: anonymous
Priority: normal Milestone: 2.5.2
Component: General Version: 2.5
Severity: major Keywords: utf8, wp-mail.php, deutsch, umlaut, has-patch, needs-testing
Cc:

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

wp-mail.php.patch (2.2 kB) - added by Laenny on 04/23/08 07:29:25.
Patch using iconv to convert most encodings to utf8

Change History

04/21/08 01:58:36 changed by revolution48

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

04/23/08 06:57:00 changed by Laenny

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.

04/23/08 07:29:25 changed by Laenny

  • attachment wp-mail.php.patch added.

Patch using iconv to convert most encodings to utf8

04/23/08 07:30:34 changed by Laenny

  • keywords changed from utf8, wp-mail.php, deutsch, umlaut to utf8, wp-mail.php, deutsch, umlaut, has-patch, needs-testing.

added has-patch and needs-testing flags