problem encoding using SendMailTransformer
Hi all I have a problem using the code of: org.apache.cocoon.mail.transformation.SendMailTransformer, when I send an email, target user always receive the field body with strange characters, so seemd bad encoding, and is curious only the field body, the subject is ok. I work with encoding UTF-8, and I check Tomcat configuration is good: * parameter: URIEncoding="UTF-8" * SetCharacterEncoding = UTF-8 * container-encoding = utf-8 * form-encoding = utf-8 I check encoding os serializers on Cocoon, too: UTF-8 -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd UTF-8 I only see that There is any problem on AbstractSAXTransformer to recovery data from textarea field on HTML, because is the diference between field subject and body. Thank you -- View this message in context: http://old.nabble.com/problem-encoding-using-SendMailTransformer-tp29886850p29886850.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
On Tue, 2010-10-05 at 05:26 -0700, mvalencia wrote: > Hi all > > I have a problem using the code of: > org.apache.cocoon.mail.transformation.SendMailTransformer, when I send an > email, target user always receive the field body with strange characters, so > seemd bad encoding, and is curious only the field body, the subject is ok. > > I work with encoding UTF-8, and I check Tomcat configuration is good: > * parameter: URIEncoding="UTF-8" > * SetCharacterEncoding = UTF-8 > * container-encoding = utf-8 > * form-encoding = utf-8 > > I check encoding os serializers on Cocoon, too: > src="org.apache.cocoon.serialization.XMLSerializer"> > UTF-8 > > src="org.apache.cocoon.serialization.XMLSerializer"> > -//W3C//DTD XHTML 1.0 Strict//EN > > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd > UTF-8 > > > I only see that There is any problem on AbstractSAXTransformer to recovery > data from textarea field on HTML, because is the diference between field > subject and body. hmm, can you send us the xml that comes in just BEFORE the SendMailTransformer? Just add BEFORE and see whether there is the correct encoding in the body. salu2 > > Thank you -- Thorsten Scherler codeBusters S.L. - web based systems http://www.codebusters.es/ - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
Hi I did what you tell me, and the result is: mail-int.andaluciajunta.es 25 miguel.valen...@juntadeandalucia.es miguel.valen...@juntadeandalucia.es españa camión Nombre del remitente: prueba, Miguel Mensaje:Prueba de mensaje en españa, camión. miguel.valen...@juntadeandalucia.es It's seems that all text lose encoding, but I have checked that emails have subject correct and bad encoding on body field. I load a test email: http://old.nabble.com/file/p29889393/test-email.txt test-email.txt -- View this message in context: http://old.nabble.com/problem-encoding-using-SendMailTransformer-tp29886850p29889393.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
On Tue, 2010-10-05 at 10:17 -0700, mvalencia wrote: > Hi > > I did what you tell me, and the result is: The first line (the xml declaration) is? > > > mail-int.andaluciajunta.es > 25 > miguel.valen...@juntadeandalucia.es > miguel.valen...@juntadeandalucia.es > españa camión > > Nombre del remitente: prueba, Miguel > Mensaje:Prueba de mensaje en españa, camión. > > miguel.valen...@juntadeandalucia.es > > > Did you use a ? Can you attach the xml to exclude problems that the mail client may produce? The underlying server has the locale UTF8_ES? > It's seems that all text lose encoding, but I have checked that emails have > subject correct and bad encoding on body field. > I load a test email: > http://old.nabble.com/file/p29889393/test-email.txt test-email.txt Hmm, let us do some tests: 1) create a new match where you use the above input but a) use #&266; for all latin characters b) write the "españa" yourself where you save the document and store them on the file system. 2) use and and create a match for the body. What is happening? salu2 -- Thorsten Scherler codeBusters S.L. - web based systems http://www.codebusters.es/ - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
This is the matches: I comment transform "constcorreopresidente" y I put the value of field direct on file propmail.xml and the sendmail works OK. I change serializer to different charset but the problem isn't there. I think the problem is when the data are received on transform "constcorreopresidente" with request-param, because the program jump to sendmail (It is a class that extend from AbstractSAXTransformer, really is @version $Id: SendMailTransformer.java 607381 2007-12-29 05:42:58Z vgritsenko) then the field body has lost the encoding. However I come back to do the test that you tell me. -- View this message in context: http://old.nabble.com/problem-encoding-using-SendMailTransformer-tp29886850p29897843.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
On Wed, 2010-10-06 at 08:26 -0700, mvalencia wrote: > This is the matches: > > > > value="{global:conectorXmlPath}correos/parametros-action-validator.xml"/> > > > > > > > > > > > > > >src="{global:conectorXmlPath}correos/error-form-presidente.xml"/> > > > > > I comment transform "constcorreopresidente" y I put the value of field > direct on file propmail.xml and the sendmail works OK. I change serializer > to different charset but the problem isn't there. > I think the problem is when the data are received on transform > "constcorreopresidente" with request-param, because the program jump to > sendmail (It is a class that extend from AbstractSAXTransformer, really is > @version $Id: SendMailTransformer.java 607381 2007-12-29 05:42:58Z > vgritsenko) then the field body has lost the encoding. > > However I come back to do the test that you tell me. can be the problematic part, since you take the value from the request. I can remember we applied the tips http://cocoon.apache.org/2.2/1366_1_1.html once in one of the apps. AFAIR there should be the SetCharacterEncodingFilter in your code base. HTH salu2 -- Thorsten Scherler codeBusters S.L. - web based systems http://www.codebusters.es/ - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
can be the problematic part, since you take the value from the request. I can remember we applied the tips http://cocoon.apache.org/2.2/1366_1_1.html once in one of the apps. AFAIR there should be the SetCharacterEncodingFilter in your code base. Yes, SetCharacterEncodingFilter is a filter defined on web.xml of Cocoon Application: SetCharacterEncoding es.sadesi.filter.SetCharacterEncodingFilter encoding UTF-8 .. SetCharacterEncoding DispatcherServlet . I have test put encoding on HTML FORM, so with the parameter: accept-charset="UTF-8" on FORM tag, but it isn't work. It seems encoding lose when data go to block conector since Cocoon application, but I not sure. -- View this message in context: http://old.nabble.com/problem-encoding-using-SendMailTransformer-tp29886850p29914526.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
On 10/08/2010 02:36 PM, mvalencia wrote: can be the problematic part, since you take the value from the request. I can remember we applied the tips http://cocoon.apache.org/2.2/1366_1_1.html once in one of the apps. AFAIR there should be the SetCharacterEncodingFilter in your code base. Yes, SetCharacterEncodingFilter is a filter defined on web.xml of Cocoon Application: SetCharacterEncoding es.sadesi.filter.SetCharacterEncodingFilter encoding UTF-8 .. SetCharacterEncoding DispatcherServlet . I have test put encoding on HTML FORM, so with the parameter: accept-charset="UTF-8" on FORM tag, but it isn't work. It seems encoding lose when data go to block conector since Cocoon application, but I not sure. You could check whether the browser when it display the form to the user actually uses the correct encoding (UTF-8). -- Andre H. Juffer | Phone: +358-8-553 1161 Biocenter Oulu and | Fax: +358-8-553-1141 Department of Biochemistry | Email: andre.juf...@oulu.fi University of Oulu, Finland | WWW: www.biochem.oulu.fi/Biocomputing/ StruBioCat | WWW: www.strubiocat.oulu.fi NordProt | WWW: www.nordprot.org Triacle Biocomputing | WWW: www.triacle-bc.com - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
Hi Andre I load file with HTTP header of web page to send email: http://old.nabble.com/file/p29914700/HTTP_header_Email-send.txt HTTP_header_Email-send.txt I see that Accept-Charset parameter contains UTF-8 and in query-string data are codified right. Besides I check encoding browser is UTF-8. -- View this message in context: http://old.nabble.com/problem-encoding-using-SendMailTransformer-tp29886850p29914700.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
Hello, I think you need to set URIencoding in your tomcat connector: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Common_Attributes |URIEncoding| This specifies the character encoding used to decode the URI bytes, after %xx decoding the URL. If not specified, ISO-8859-1 will be used. had this problem myself recently . . . -Charles Hi all I have a problem using the code of: org.apache.cocoon.mail.transformation.SendMailTransformer, when I send an email, target user always receive the field body with strange characters, so seemd bad encoding, and is curious only the field body, the subject is ok. I work with encoding UTF-8, and I check Tomcat configuration is good: * parameter: URIEncoding="UTF-8" * SetCharacterEncoding = UTF-8 * container-encoding = utf-8 * form-encoding = utf-8 I check encoding os serializers on Cocoon, too: UTF-8 -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd UTF-8 I only see that There is any problem on AbstractSAXTransformer to recovery data from textarea field on HTML, because is the diference between field subject and body. Thank you
Re: problem encoding using SendMailTransformer
On Fri, 2010-10-08 at 04:36 -0700, mvalencia wrote: > > can be the problematic part, since you take the value from the request. > > I can remember we applied the tips > http://cocoon.apache.org/2.2/1366_1_1.html once in one of the apps. > AFAIR there should be the SetCharacterEncodingFilter in your code base. > > > Yes, SetCharacterEncodingFilter is a filter defined on web.xml of Cocoon > Application: > > SetCharacterEncoding > > es.sadesi.filter.SetCharacterEncodingFilter > > encoding > UTF-8 > > > .. > > SetCharacterEncoding > DispatcherServlet > > . > > I have test put encoding on HTML FORM, so with the parameter: > accept-charset="UTF-8" on FORM tag, but it isn't work. It seems encoding > lose when data go to block conector since Cocoon application, but I not > sure. are you using post or get for the form? salu2 -- Thorsten Scherler codeBusters S.L. - web based systems http://www.codebusters.es/ - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
The form used get method, because with the post method not work the "request-param" of Cocoon. -- View this message in context: http://old.nabble.com/problem-encoding-using-SendMailTransformer-tp29886850p29931504.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
Hi Charles I have configured the parameter URIEncoding to UTF-8, even I used the parameter useBodyEncodingForURI but I go on with the same problem. -- View this message in context: http://old.nabble.com/problem-encoding-using-SendMailTransformer-tp29886850p29931532.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
Ah, yes, I see that in your original message. In case it helps, here is how discovered the cause of my problem. I used eclipse with WTP (web tools project) with the appropriate versions of cocoon, tomcat and my application as projects. I put a breakpoint at a place where I knew I would see the garbled characters and then went back through the method calls to find the point where they were created. In my case it was the tomcat Connector object using its default character encoding. On 10/8/10 8:02 AM, Charles Yates wrote: Hello, I think you need to set URIencoding in your tomcat connector: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Common_Attributes |URIEncoding| This specifies the character encoding used to decode the URI bytes, after %xx decoding the URL. If not specified, ISO-8859-1 will be used. had this problem myself recently . . . -Charles Hi all I have a problem using the code of: org.apache.cocoon.mail.transformation.SendMailTransformer, when I send an email, target user always receive the field body with strange characters, so seemd bad encoding, and is curious only the field body, the subject is ok. I work with encoding UTF-8, and I check Tomcat configuration is good: * parameter: URIEncoding="UTF-8" * SetCharacterEncoding = UTF-8 * container-encoding = utf-8 * form-encoding = utf-8 I check encoding os serializers on Cocoon, too: UTF-8 -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd UTF-8 I only see that There is any problem on AbstractSAXTransformer to recovery data from textarea field on HTML, because is the diference between field subject and body. Thank you - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: problem encoding using SendMailTransformer
hi everybody I have found one solution to my problem. I change attribute "mime-type" of email:body on xsl page from transform cocoon to value:"text/xml" and now the email arrive well. Exactly: old = new = In the code of SendMailTransformer.java I see that when mime-type is text/plain body set with MimeMessage variable and when mime-type is another value the body field set with MimeBodyPart variable. It seem that MimeMessage variable does not manage encoding correctly. Anyway for me the matter is fixed. Thanks all. -- View this message in context: http://old.nabble.com/problem-encoding-using-SendMailTransformer-tp29886850p29950964.html Sent from the Cocoon - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org