Closed (fixed)
Project:
Mime Mail
Version:
6.x-1.0-alpha6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2010 at 11:38 UTC
Updated:
7 May 2011 at 10:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
sgabe commentedFirst, print out the $encoding variable to see its value. Second, try to replace it with 'auto' and let the mb_convert_encoding() function decide which encoding to use.
$body = mb_convert_encoding($body, 'HTML-ENTITIES', 'auto');Comment #2
stella commentedAttached patch fixes the warning -
mb_detect_encoding()was returning false but this return value wasn't checked before callingmb_convert_encoding()Comment #4
sgabe commentedMaybe the warning is gone, but this skips the encoding entirely. Would you try with "auto" if the detection fails?
Comment #5
stella commentedI did try it with 'auto' if the detection fails, but then I get the exact same error for that line. Perhaps 'auto' is not the correct param name.
Comment #6
sgabe commentedI can't see your post with the revised patch, but I got the notification message...
Comment #7
stella commentedhere it is again, but it doesnt work
Comment #8
sgabe commentedIs the CSS Compressor still functional without the encoding?
Comment #9
nmweb commentedI'm seeing a similar error after upgrading to this mimemail version:
Fatal error: Call to undefined function mb_detect_encoding() in .../sites/all/modules/mimemail/modules/mimemail_compress/mimemail_compress.inc on line 64
The same error appears after changing the encoding as indicated in comment #1.
Has anyone found a way to fix the error? Thanks in advance.
LJ
Comment #10
sgabe commentedI am attaching a patch to check if the necessary functions exist and the encoding is successfully detected. Note that I only set the encoding of the DOMDocument if all is fine.
Please test it and report back.
Comment #11
sgabe commentedCommitted to HEAD.
Comment #12
stella commentedthanks!
Comment #14
pslcbs commentedHello,
my newsletters (simplenews) before applying the patch from #10 were good with no errors on special characters on the emails but getting the warnings after sending it
After applying the patch (same results with 6.x-1.0-alpha7 and 6.x-1.0-alpha8 versions) I don't see the warnings but the emails are full of strange characters as I show on the attached files.
Thanks for your help
Comment #15
sgabe commentedI think the filenames of the images are wrong, because the image WITH the patch shows that everything is fine.
First, we should know what is the encoding that throws this error. You can use the Devel module to see what is happening. Just add the below line after
$encoding = mb_detect_encoding($body);and report back with the result.