ez projects / enhancedezbinaryfile / forum / general / works fine, but ..
You need to be logged in to post messages in the forums. New users may register here.
|
Member since: Posts: 3 |
Tuesday 30 December 2008 3:39:54 pm Something wrong with the encoding,
For example, when I receive a letter with "D" the original "Ė" or "E!t" - "Š" How to fix this problem? |
|
Member since: Posts: 47 |
Tuesday 30 December 2008 6:33:57 pm You are using the 4.x version found here, right? Not the 3.9 version, I hope... this is broken in the 3.9 version, I think - Marco Zinn noticed that umlauts didn't work in that version.
The mail's encoding should be set by the kernel hack using eZTextCodec::internalCharset() at line 352 of collectinfo.php: //Plain Text part of Message $message = "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"". This --> eZTextCodec::internalCharset() . "\"\n" . "Content-Transfer-Encoding: 8bit\n\n"; The Š and Ė are utf-8? If you run this code from your ez root directory: <? require_once 'autoload.php'; echo eZTextCodec::internalCharset(); ?> Does it come back with utf-8 or an encoding that supports those characters? I'm assuming that these characters show up on the front-end of your site without any problem, and that should be getting the same encoding - in which case maybe it's your mail client? Certified eZPublish developer |
|
|
Member since: Posts: 3 |
Wednesday 31 December 2008 8:05:23 am I use ez 4.x version.
<? require_once 'autoload.php'; echo eZTextCodec::internalCharset(); ?> return utf-8; The standard feedback form works fine, no encoding problem. example standard feedback mail source: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: eZ Publish, Version 4.0.1 Status: X-EsetId: 37F89F2B5ADF2A6D28FE9F7C508867 enhancedezbinaryfile, mail source: MIME-Version: 1.0 Content-Type: multipart/mixed;boundary===Multipart_Boundary_507bfebd5ac2b9d5b7225126aa703526; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: eZ Publish, Version 4.0.1 Status: X-EsetId: 37F89F2B5ADF2A6D28FE9F7C508867 --==Multipart_Boundary_507bfebd5ac2b9d5b7225126aa703526 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit the mail client does well... |
|
Member since: Posts: 47 |
Saturday 03 January 2009 12:14:03 pm The only thing I see different is the quotes around the utf-8 part for the text portion of the multipart mail. That could be it, maybe... although it's not intuitive to me.
If you want to try it, then change line 364 of collectinfo.php from: "Content-Type: " . $attacharray[2] . "; charset=\"". eZTextCodec::internalCharset() . "\"\n name=\"" . to "Content-Type: " . $attacharray[2] . "; charset=". eZTextCodec::internalCharset() . "\n name=\"" . (remove the escaped quotes around the eZTextCodec::internalCharset() ) If that works well (with the text and the attachment) I'll incorporate it into the code. Alternatively, if you can send me one of the messages as an attachment then I can try it here. Certified eZPublish developer |
|
|
Member since: Posts: 3 |
Tuesday 06 January 2009 6:36:09 pm Hi Steven,
Thanks a lot for your ez extension ! As content content says, i think there is a problem with the mail encoding : For example, with chars é or è, i've got a C) or a C( I've made the previous modification you mentionned, and it seems nothing changes. Have you got any ideas to fix that ? Best regards, Lucas PS: I'm running on ez 4.0 system... |
|
Member since: Posts: 47 |
Thursday 08 January 2009 9:49:29 am O.k forget taking the quotes out - I didn't think that would make a difference anyway.
However, I took a close look at this and I'm not able to reproduce the problems - I'm using a stock ez401 installation and everything on my linux box (firefox, thunderbird, xterm and kedit/kate) is set to utf-8. So, when I send a mail with this as the xml block message and with a text file as an attachment containing these contents: testtesttest ä, ü or ö é or è "D" the original "Ė" or "E!t" - "Š" testtesttest That's exactly what I get back. Functionally, nothing is done with the uploaded file. It is read in using eZFile::getContents (a wrapper for file_get_contents/fp) and converted to base64 so that mail programs can handle it. I guess this breaks down to three things: - If you cut and paste the contents to an xml field does it show up in your browser correctly? Then your browser and site have the correct encoding. - Does the attached file show up in your mail program correctly if you have your mail program set up to open attachments automatically? If so then your mail client has the encoding set to what the encoding actually is. One potential problem that I can see is that if you have your site set in the i18n.ini to utf-8 and you send something with a different encoding it probably will confuse your mail program since the header is being set to whatever the Charset is in i18n.ini. This still shouldn't have any effect on the attachment when opened as a file, although it might come out wrong if the attachment is opened automatically in your mail client. - Does the attachment itself show up correctly when opened in a text editor (or pdf viewer, etc.) that has the correct encoding? This should always happen since functionally the attachment shoud be a bit-for-bit copy of what was uploaded (which I've verified with md5sum). If it doesn't show up correctly then your text editor really isn't the right encoding. Certified eZPublish developer |
|
|
Member since: Posts: 3 |
Monday 12 January 2009 6:26:52 pm Hi,
My environment is fully set to UTF-8. The encoding error seems appear with the $mail->setContentType function. After reading the doc (http://pubsvn.ez.no/doxygen/trunk...ml#ac8ea2b85f149bd38ae1c56b36fdba0b) all you made seems ok... but not for me. I don't understand. If you have others ideas ? Thx Lucas PS: I try $mail->setContentType( "multipart/mixed;boundary=$mime_boundary",eZTextCodec::internalCharset(),"8bit",false ); but doesn't work. |
|
|
Member since: Posts: 3 |
Tuesday 13 January 2009 5:41:28 pm - Does the attached file show up in your mail program correctly if you have your mail program set up to open attachments automatically? If so then your mail client has the encoding set to what the encoding actually is. In fact, the error may be here. In Gmail, files are correctly attached but not in my mail program (Mail, i'm on os x). I've got : --==Multipart_Boundary_5124c83585ccb15e07929500b867b98e Content-Type: image/gif; charset=utf-8 name=image.gif Content-Transfer-Encoding: base64 Content-Disposition: inline; filename=image.gif {Encrypted base64 file}== (i've replace the following encryption image by {Encrypted base64 file} to not pollute the post. And, at the end of the message : --==Multipart_Boundary_9961bddbea2ec9e3d978923acfa938b5-- --=-- I think i'm close, can you give me a little help again ? :) Thanks Lucas |
|
Member since: Posts: 47 |
Saturday 07 February 2009 10:01:35 am Sorry for the late reply, apparently I didn't get the notification.
I'm not sure what your mail client is doing... and I don't know where it's getting the encrypted base64 from... but, can you cut and paste the block of base64 encoded text and decode it using base64_decode and save it in a file (image.gif)? Is it the image that you attached? Certified eZPublish developer |
|
Member since: Posts: 1 |
Thursday 15 March 2012 12:10:13 pm old version on ezp 3.6.3
$mail->setContentType( "multipart/mixed;boundary=$mime_boundary",false,false,false ); my solution on ezp 3.10.1 $mail->setContentType( "multipart/mixed",false,false,false,$mime_boundary ); --- |
|
Member since: Posts: 47 |
Friday 16 March 2012 10:59:44 pm Great, Dirk. Thanks for the tip.
That's interesting. Maybe the problem has been different parameters for the setContentType with different versions of ezpublish. Of course, it's been over a year (maybe even two) since I've touched a 3.x installation. Certified eZPublish developer |
You need to be logged in to post messages in the forums. New users may register here.