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

    Just built a site using Evo.
    Hosted on Apache, PHP 5.

    I have a class I wrote that pulls an array of data out of the DB and displays it front end.
    One of the fields in the DB is straight HTML.

    When I display this frontend I get some unusual results.
    The Euro symbols, which are in the DB as €

    Display on one page as: %u20AC
    And on another page as €

    Now the weird thing is that both pages uses the same header chunk, where the encoding is set to:
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    I know %u20AC is unicode, but I can’t figure out why it is coming out like that on my website.
    When I view the source, my &euro; is there fine?

    Any ideas...
    Thanks in advance...

    J



      • 15083
      • 697 Posts
      erm...think I posted this in the wrong board!
        • 22303 MODX Staff
        • 10,725 Posts
        Sounds like the data is stored in a UTF8 collation in the database, instead of latin1.
          • 15083
          • 697 Posts
          Quote from: OpenGeek at Nov 25, 2010, 09:31 AM

          Sounds like the data is stored in a UTF8 collation in the database, instead of latin1.

          That is correct...now here the head scratcher....
          One one page: Displays fine as €
          On another page (same template) it shows the unicode!!!

          I assumed it was a caching issue, but cleared my cache etc.
          I have traced the problem back to an AJAX form post that submits data into modx_site_content.content. The Ajax post is obviously encoding, and im not decoding in my PHP Snippet before I put it in the DB.

          That still does not explain why its fine on one page and not on the other!