7 Replies Latest reply on Nov 4, 2008 9:54 AM by lelleh

    Bogus encoding in quoted-printable

    rave
      Hi there,

      I'm experiencing troubles with charset utf8 in quoted-printable encoding.
      All umlauts passed to the view (which actually is an email template),
      get a wrong encoded in the wrong charset (iso8859-1) as soon as they are encoded as quoted-printable.
      Example: können is converted to k=C3=B6nnen
      It looks to me, as if the input is wrongly treated as iso8859-1 while it actually is utf8.

      Any clue, anybody?
        • 1. Re: Bogus encoding in quoted-printable
          pmuir

          Show the template.

          • 2. Re: Bogus encoding in quoted-printable
            rave

            |<?xml version="1.0" encoding="UTF-8"?>
            <m:message charset="UTF-8" 
                       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"> 
              <m:from name="no reply" address="no-reply@domain.ext"/>
              <m:to address="#{mailStatAction.email.recipient}"/>
              <m:subject>#{mailStatAction.email.subject}</m:subject>
              <m:body>
                 <h:outputText value="#{mailStatAction.email.textHTML}" escape="false" />
                <f:facet name="alternative">
                 #{mailStatAction.email.textPlain}
                </f:facet>
              </m:body>
              <m:attachment value="#{mailStatAction.email.attachmentFile}" contentType="application/x-zip-compressed" fileName="#{mailStatAction.email.attachmentName}" />
            </m:message>|



            mailStatAction.email.textPlain comes directly out of a message-bundle (utf8)

            • 3. Re: Bogus encoding in quoted-printable
              pmuir

              Ok, I need an example to reproduce, and an issue in JIRA. Bear in mind that I use a Mac Book with UK settings, so if I need to alter Gmail or Mail.app to show the issue, you need to tell me how ;-)

              • 4. Re: Bogus encoding in quoted-printable
                rave
                Ok, first things first; the properties-file "messages_de.properties" contains:

                f_email_monthly_plain=Wenn Sie diesen Text lesen k\u00F6nnen, aktivieren Sie bitte das HTML-Format.

                this property is read by an action-class (MailStatAction) like this:

                String textPlain = messages.get("f_email_monthly_plain");

                then putted into a helper object:

                m_Email = new statEmail(recipient, subject, textHTML.toString(), textPlain, m_ZipName, attachmentFile);

                and finaly rendered by the template above:

                renderer.render("incl/email_template.xhtml");

                Is this enough for you or do you need more specific information?











                • 5. Re: Bogus encoding in quoted-printable
                  wachtda.scsi.gmx.ch

                  Hello Pete


                  I opened a new jira for the problem of Ramon (JBSEAM-3636), as we work on the same project.


                  Hope this is not a huge bug...
                  ;-)


                  Greetings
                  Daniel

                  • 6. Re: Bogus encoding in quoted-printable
                    lelleh

                    Sorry if this is the wrong place to comment, my issue is not with seam mail, but I was just going to post something similarly to the Seam forums, so I'm commenting here:


                    Adding


                    <s:link id="myparam" value="utf8: Ø">
                      <f:param name="utf8Param" value="Ø"/>
                    </s:link>



                    to an  .xhtml-page results in the link displayed properly HTMLEncoded with &Oslash;.


                    The parameter OTOH is converted as if it was in ISO8859-1 to UTF-8 and ends up: utf8Param=%C3%98&amp;


                    This is so, even when following the advice in the docs 16.1.3 to add a character-encoding-filter,
                    and also adding a meta-tag to the xhtml with http-equiv=Content-Type content=text/html; charset=UTF-8.


                    (Yes, I am randomly looking for a solution to this and am a seam/jsf beginner...)



                    (my environment is Debian Lenny, JBoss 4.3 and 5.0, but I have the same on RHEL5.2 with JBoss 4.2. Seam 2.0.2SP1 and 2.1.0SP1)


                    • 7. Re: Bogus encoding in quoted-printable
                      lelleh

                      Sorry for the noise.


                      useBodyEncodingForURI="true" worked fine, it was just that I was using mod_jk, so I had to add it to the ajp connector as well...


                      Good luck with the real issue :)