gobzer
Chevereto Member
First, the bug:
All feedback emails, containing non-latin chars become garbled like that -
аÑнолÑд
Debug process:
I went to /app/themes/Peafowl/pages/contact.php to see what is happening.
We're getting utf-8 input from a form (because feedback page and whole site is utf-8) and sending it to a mailer class.
/app/lib/classes/class.mailer.php tells us that the mailer is an extension for phpmailer, which is located at
/app/vendor/phpmailer/class.phpmailer.php
Looking through Send and preSend functions I noticed CharSet parameter which is explained as "The character set of the message" and defaults to 'iso-8859-1'.
contact.php does not set this parameter, so phpmailer processes utf-8 message with a wrong 'iso-8859-1' charset.
I've searched for a phpmailer encoding problems and found this document:
http://stackoverflow.com/questions/2491475/phpmailer-character-encoding-issues
Where people send their messages with
$mail->CharSet='UTF-8';
Solution:
Edit
/app/themes/Peafowl/pages/contact.php
Add
$mail->CharSet='UTF-8';
after
$mail->Timeout = 30;
This solution is general, not specific.
Improvement:
I also think that it would be cool if this feedback form would automaticaly fill the name and email inputs if user is logged in.
All feedback emails, containing non-latin chars become garbled like that -
аÑнолÑд
Debug process:
I went to /app/themes/Peafowl/pages/contact.php to see what is happening.
We're getting utf-8 input from a form (because feedback page and whole site is utf-8) and sending it to a mailer class.
/app/lib/classes/class.mailer.php tells us that the mailer is an extension for phpmailer, which is located at
/app/vendor/phpmailer/class.phpmailer.php
Looking through Send and preSend functions I noticed CharSet parameter which is explained as "The character set of the message" and defaults to 'iso-8859-1'.
contact.php does not set this parameter, so phpmailer processes utf-8 message with a wrong 'iso-8859-1' charset.
I've searched for a phpmailer encoding problems and found this document:
http://stackoverflow.com/questions/2491475/phpmailer-character-encoding-issues
Where people send their messages with
$mail->CharSet='UTF-8';
Solution:
Edit
/app/themes/Peafowl/pages/contact.php
Add
$mail->CharSet='UTF-8';
after
$mail->Timeout = 30;
This solution is general, not specific.
Improvement:
I also think that it would be cool if this feedback form would automaticaly fill the name and email inputs if user is logged in.