We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15001
    • 697 Posts
    Hi,Thanks for the tip.
    I’m writing something more automatic as complement to phpMyAdmin, because the database can be large. Regards.
      • 886
      • 39 Posts
      Quote from: Jul at Jul 02, 2010, 03:27 AM

      (...)but deleting it and making a new one with the correct collation set from the beginning solved it.

      It is not neccessary to delete the table.

      Yeah, i got it when you said that previously.. Just, when i had the problem i hadn’t figured it out, and since i was just testing modx, my db was practically empty, so i wouldn’t lose much by deleting it..

      I wasn’t offering a solution saying you should delete your db, just commenting on why it worked for me.. ;-)
      Thanks for the specific instructions though, i’m sure it’ll help somebody sooner or later
        • 15001
        • 697 Posts
        I still get a problem with MaxiGallery.

        In phpMyAdmin, I switched the modx_maxigallery table from iso-8859-1 to utf-8 using the "Operations" tab.Then, I changed the collation from iso-8859-1 to utf-8 for MaxiGallery table columns.

        In the call to the MaxiGallery snippet, I added this parameter: &use_charset=`UTF-8`

        The browser and MODx caches were emptied.

        The "è" still displays as "è", despite the page charset is utf-8.
        I tried to retype the string directly in phpMyAdmin and save it.
        The problem remains.

        Charset problem with snippet solved: see message #15 in this thread for explanations.

        @alejaaandro: Thanks for your feedback. I just wanted to inform people that it is not necessary to delete the tables, so they don’t loose data. wink

          • 3749
          • 24,544 Posts
          Your change will only affect new data added to the table. It doesn’t translate data that’s already there.

          Some people (including me) have had success with this: http://bobsguides.com/convert-db-utf8.html
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 15001
            • 697 Posts
            Thanks for the script, but the data in my table are already in utf-8.

            As proof, the "è" character displays "è".

            I also saved a text file containing a "è" and opened it with an hexadecimal editor.
            The "è" was represented as "è" or C3 A8 in hexadecimal.

            Snippet charset problem solved: The issue was due to the htmlentities() function, which was used by a phx modifier. htmlentities() uses "iso-8859-1". The charset must be specified explicitely when using utf-8. More details here:
            http://modxcms.com/forums/index.php/topic,44476.msg297471.html#msg297471

            I advise to all snippet developpers to explicitely specify the charset argument when using htmlentities() PHP function.
            This will increase snippet compatiblity with miscelaneous charsets and not only iso-8859-1.