Main Content

Magnolia Community Forums: Get help with Magnolia: Magnolia mail encoding problems


  • kevinBC
    kevinBC
    Full name: Kevin Pfaff
    Posts: 7
    Last post: Feb 21, 2017 9:25:30 AM
    Registered on: May 20, 2014
    Magnolia mail encoding problems
    #1 by kevinBC on Jan 16, 2017 5:12:53 PM

    Hello,

    I have:
    magnolia 5.2.4
    tomcat 7.0.52
    Ubuntu 4.2.0
    JCR 2.6.4
    Java 1.7.0_51

    The Problem is following:
    The public and author instance of magnolia are running on the same tomcat.
    If I send a mail from the author instance, everything is correct (äüößé...).
    If I send a mail from the live (public) instance, it differs. If the characters are directly in the template they are displayed correct, but if the characters are written by a person per html form, they are encoded wrong.

    Example:
    Auther instance:
    Template:
    Name: ${name}
    Test: äöüßé

    Input from website: name = Täöüéßt.

    Mail in mailclient:
    Name: Täöüéßt
    Test: äöüßé

    public instance:
    Same template

    Input from website: name = Täöüéßt.

    Mail in mailclient:
    Name: täüößét
    Test: äöüßé

    It seems that the template interpolation of freemarker has something to do with it.
    I never changed anything regarding encoding in public or live instance so I am quit at a loss.

    Someone any ideas?


    Thanks & regards,
    KBC

  • had
    had
    Full name: Jan Haderka
    Posts: 1,405
    Last post: Feb 6, 2017 1:59:05 PM
    Re: Magnolia mail encoding problems
    #2 by had on Jan 17, 2017 10:05:01 AM

    Hi Kevin,

    most likely cause is that encoding of the input form on your website is not set and browser then uses user default (ISO) instead of UTF-8.

    HTH,
    Jan

  • kevinBC
    kevinBC
    Full name: Kevin Pfaff
    Posts: 7
    Last post: Feb 21, 2017 9:25:30 AM
    Registered on: May 20, 2014
    Re: Magnolia mail encoding problems
    #3 by kevinBC on Jan 19, 2017 9:56:55 AM

    Hi Jan,

    thanks for the suggestion.
    It is kinda strange though, we use the same ftl-templates for both live and author.
    We checked that the <meta charset="utf-8"> is present in the pages header and like I said the templates for the mail form are one and the same.

    But I will try this, just to be sure even if it would be strange.

    Tanks,
    KBC

  • bvass
    bvass
    Full name: Bence Vass
    Posts: 21
    Last post: Jan 20, 2017 10:43:28 AM
    Registered on: Dec 11, 2012
    Re: Magnolia mail encoding problems
    #4 by bvass on Jan 20, 2017 10:43:28 AM

    Hi,

    Also make sure to have this setting in your Tomcat connector: URIEncoding="UTF-8"

    BR

  • kevinBC
    kevinBC
    Full name: Kevin Pfaff
    Posts: 7
    Last post: Feb 21, 2017 9:25:30 AM
    Registered on: May 20, 2014
    Re: Magnolia mail encoding problems
    #5 by kevinBC on Jan 25, 2017 10:28:57 AM

    Hallo,

    @Jan
    I just tried adding "accept-charset="UTF-8"" to the form, but nothing changed.
    You wrote to encode the input, how do I do that? Or do you mean the formenctype?

    @Bence
    We already had set the URIEncoding="UTF-8" to the connector for port 8080 and 8009, we needed this for the search functionality to support umlauts.

    Thanks,
    KBC

  • had
    had
    Full name: Jan Haderka
    Posts: 1,405
    Last post: Feb 6, 2017 1:59:05 PM
    Re: Magnolia mail encoding problems
    #6 by had on Jan 28, 2017 2:16:48 PM

    accept-charset should have been enough. If it is not, problem is likely elsewhere. How are you submitting those forms? Via POST or GET request? Are your users accessing public instance directly or via apache/mod_jk or via proxy?

  • kevinBC
    kevinBC
    Full name: Kevin Pfaff
    Posts: 7
    Last post: Feb 21, 2017 9:25:30 AM
    Registered on: May 20, 2014
    Re: Magnolia mail encoding problems
    #7 by kevinBC on Feb 21, 2017 9:25:30 AM

    The forms are using POST and we are using mod_proxy.
    This also counts for the private instance.

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/