Re: Bad caractere inside mails forum in french
Reply #11 –
I have narrowed down the problem to our Html2Md.class.php file in the sources/subs directory .... This function is used to convert HTML to Markdown which we use for emails.
The issue is really with PHP's DomDocument function implementation which behaves differently on different versions of PHP as well as variants of *nix. This variation really is a PITA.
What we have now is a "trick" to let the function know that we want to handle all text as UTF8. We also use <xml which allows us to silence any markup errors found. You can find this trick recommended in many places and it has not failed ... until now !
$this->doc->loadHTML('<?xml encoding="UTF-8">' . $this->html);
Using the supplied FTP access (thank you!) I was able to test several things, and it appears that this will work for now
$this->doc->loadHTML('<?xml encoding="UTF-8"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>' . $this->html . '</body></html>');
You can use that for now, but I have to check on a few things ... mainly I think we will need to capture the text inside <body>(.*)</body> to prevent a double wrapping (not an issue unless you are using the email reply capability)