Not sure whether I should post this here, but here I go anyway...
I've had a bit of trouble with the contact_form script from 1.0.2. I'm doing a French website, so I hacked my way through plugin.contact_form.php to have French text and labels, to add information to the body of the message, etc. But I've had problems with character encoding, and these are not related to my (poor and clumsy) changes, since they happen with the original script and with Version: 1.4 (20061010) of the script as well.
My website is using UTF-8 (http headers ok, meta tag ok), and the messages sent are UTF-8 as well... but the e-mails sent are not declared as utf-8.
TEST 1:
sending a message with
- ascii characters only in the title ;
- non-ascii characters in the message's body.
Result : both gmail and Thunderbird reckon the message is in iso-8859-1
TEST 2:
sending a message with
- non-ascii characters in the title ;
- non-ascii characters in the message's body.
Result : both gmail and Thunderbird reckon the message is in UTF-8
Which means that the message is not sent with any charset information. Ouch. I checked it with Thunderbird (taking a look at the headers of the received e-mails) : no charset information.
So I had to hack the original script to add charset information. I did it that way (not sure that's how you do it for e-mail, but I tried it and it seems to work fine) :
Code: Select all
//$extra .= "Content-Type: text/plain\r\n";
$extra .= "Content-Type: text/plain; charset=UTF-8\r\n";
Well, it's a quick and dirty hack, but it seems to work fine.
I'm no developer, so I can't code something more reliable (fetching the actual encoding from the cms config, or maybe from the page's http headers / server information?). But I thought that pointing this out could be useful.

Have a nice day.
