We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14617
    • 47 Posts
    Hi all

    I am making a site that contains a webshop. On the checkout page there is a pay button which opens a popup to the payment gateway. This popup window is controlled by the payment gateway and is encoded in iso-8859-1. My site is utf-8. I send variables to the popup through hidden fields in a form which I have stored in a chunk. Because of special danish chars (æ, ø and å) I get problems with encoding in the popup - they are not being show correctly.

    I have tried to change the encoding in the backend to iso-8859-1 which solved my popup problem but creates a bunch of new ones so this is not an acceptable solution.
    I have tried to encode theese special chars to eg. ø = ø but they are still encoded wrong in the popup. It seems modx translates ø.

    Now my question is: Is there some way I can escape modx’s encoding for these special chars? Is there anyone who can think of a solution to this problem?

    All help is greatly appreciated

    Jonas
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: jonasgrau at Oct 27, 2008, 08:14 AM

      I am making a site that contains a webshop. On the checkout page there is a pay button which opens a popup to the payment gateway. This popup window is controlled by the payment gateway and is encoded in iso-8859-1. My site is utf-8. I send variables to the popup through hidden fields in a form which I have stored in a chunk. Because of special danish chars (æ, ø and å) I get problems with encoding in the popup - they are not being show correctly.

      I have tried to change the encoding in the backend to iso-8859-1 which solved my popup problem but creates a bunch of new ones so this is not an acceptable solution.
      I have tried to encode theese special chars to eg. ø = ø but they are still encoded wrong in the popup. It seems modx translates ø.

      Now my question is: Is there some way I can escape modx’s encoding for these special chars? Is there anyone who can think of a solution to this problem?
      You’ll have to POST ISO-8859-1 encoded data if the payment gateway you are posting to requires it (which it sounds like it does). The only way to do that is to set the modx charset to ISO-8859-1. Then, you’ll need to pick a compatible language file for the manager, and make sure all of your content is also ISO-8859-1 (or use the new SET NAMES feature with latin1 charset to convert your utf8 data to a compatible encoding on the fly, though this is less efficient).
        • 14617
        • 47 Posts
        Hi.

        OK. So no way of working around this keeping the charset to utf-8? Actually my database is already latin1 so I guess it’s not that bad to switch manager encoding. Thanks for the reply.

        Jonas