1 2 Previous Next 19 Replies Latest reply on Apr 16, 2007 4:49 PM by rlhr

    Email and internationalization

      Hello,

      Non UTF8 characters in the subject line are not rendered properly: For instance the word 'Café' becomes 'Caf&# 233;'

      The email body is fine.
      Is this a bug or I'm missing something?

      Thanks,

      Richard

        • 1. Re: Email and internationalization
          pmuir

          I put a fix into CVS earlier today ;)

          It would be great if you could test it for me :)

          • 2. Re: Email and internationalization

            I tried jboss-seam-CVS.20070405 and still see the problem.
            Is the fix in that build or is it going to be in the next build?

            • 3. Re: Email and internationalization
              pmuir

              Erm, looks like I committed after cruisecontrol built the last nightly.

              Anyway, building Seam from CVS is dead simple ;)

              cvs -d:pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jboss co jboss-seam
              cd jboss-seam
              ant


              • 4. Re: Email and internationalization

                I'm afraid the fix didn't do it. I still get the same problem.

                • 5. Re: Email and internationalization
                  pmuir

                  Show me the template

                  • 6. Re: Email and internationalization
                    tazman

                    I can confirm that now my email subjects too are utf-8 encoded.

                    However, I cannot send asynchronous mails anymore. I'm getting this:

                    14:49:00,875 ERROR [TimerImpl] Error invoking ejbTimeout: javax.ejb.EJBException
                    : java.lang.RuntimeException: exception invoking: newMessage


                    If I remove the @Asynchronous annotation from the method newMessage(), sending works again.

                    I'm using JSF RI 1.2 with Seam 1.2.1 (latest from CVS).

                    tazman

                    • 7. Re: Email and internationalization

                      here is my email template:

                      <?xml version="1.0" encoding="ISO-8859-1" ?>
                      <m:message xmlns="http://www.w3.org/1999/xhtml"
                       xmlns:m="http://jboss.com/products/seam/mail"
                       xmlns:h="http://java.sun.com/jsf/html"
                       xmlns:f="http://java.sun.com/jsf/core"
                       importance="normal"
                       requestReadReceipt="false">
                       <m:header name="X-Sent-From" value="Richard" />
                       <m:from name="richard" address="xxx@yyy.com" />
                       <m:to name="#{user.username}">#{user.email}</m:to>
                       <m:subject>#{messages.EMAIL_TEST_SUBJECT}</m:subject>
                       <m:body>
                       <html>
                       <body>
                       <p>#{messages.EMAIL_TEST_BODY}</p>
                       <p>
                       </body>
                       </html>
                       <f:facet name="alternative">
                       <h:outputText>This is the alternative text body for mail readers that don't support html</h:outputText>
                       </f:facet>
                       </m:body>
                      </m:message>


                      • 8. Re: Email and internationalization

                        I should add that EMAIL_TEST_SUBJECT and EMAIL_TEST_BODY are defined in a properties file and contains non utf8 characters.

                        • 9. Re: Email and internationalization
                          tazman

                          try to apply these changes to your template:

                          <?xml version="1.0" encoding="utf-8" ?>
                          <m:message xmlns="http://www.w3.org/1999/xhtml"
                           xmlns:m="http://jboss.com/products/seam/mail"
                           xmlns:h="http://java.sun.com/jsf/html"
                           xmlns:f="http://java.sun.com/jsf/core"
                           importance="normal"
                           requestReadReceipt="false"
                           charset="utf-8">


                          tazman

                          • 10. Re: Email and internationalization

                            So I added charset="ISO-8859-1" to the template but still it doesn't work for the subject.

                            I'm still using the build from 4/5/2007 because it seems that a lot is going on in the last builds and I'm not quite sure how to properly setup the application...

                            • 11. Re: Email and internationalization
                              pmuir

                              As I stated above the fix was committed after the 20070405 nightly was built.

                              • 12. Re: Email and internationalization

                                Right, but I'm using the cvs version I built myself from later that day.
                                So I'm going to try to use the lastest just in case I don't have your fix.

                                I saw there are few changes in the jars for the latest build. Any hint about it?

                                • 13. Re: Email and internationalization
                                  pmuir

                                  tazman, you should be able to send async now

                                  • 14. Re: Email and internationalization

                                    Well, I took today's build and still have the same problem...

                                    The email template is defined as followed:

                                    <?xml version="1.0" encoding="ISO-8859-1" ?>
                                    <m:message xmlns="http://www.w3.org/1999/xhtml"
                                     xmlns:m="http://jboss.com/products/seam/mail"
                                     xmlns:h="http://java.sun.com/jsf/html"
                                     xmlns:f="http://java.sun.com/jsf/core"
                                     importance="normal"
                                     requestReadReceipt="false"
                                     charset="ISO-8859-1">
                                     <m:header name="X-Sent-From" value="test" />
                                     <m:from name="test" address="xxx@yyy.com" />
                                     <m:to name="#{user.username}">#{user.email}</m:to>
                                     <m:subject>#{messages.EMAIL_SUBJECT}</m:subject>
                                     <m:body>
                                     <html>
                                     <body>
                                    ...
                                     </body>
                                     </html>
                                     </m:body>
                                    </m:message>
                                    


                                    1 2 Previous Next