We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19369
    • 1,098 Posts
    Hi, I have noticed that some files in the lang folder (sitename\assets\snippets\eform\lang) of eform have problems with special characters (es. àèìòù...). I had this problem on:
    1. francais.inc.php
    2. italian.inc.php
    3. spanish.inc.php

    I have fixed this with the following code, placed at the bottom of each file:
    foreach ($_lang as $_lang_key => $_lang_value) {
      if (substr($_lang_key, 0, 3) != 'ef_') continue;
      $_lang[$_lang_key] = utf8_encode($_lang_value);
    }


    Also, in the spanish.inc.php there is a mistake, this line should be changed form this:
    $_lang["ef_validation_message"] = "<strong>Se detectaron algunos errores:</strong>
    ";

    to this:
    $_lang["ef_validation_message"] = "<div class=\"errors\"><strong>Se detectaron algunos errores:</strong>
    [+ef_wrapper+]</div>";

    Basically there is no "[+ef_wrapper+]" placeholder in the original file... [ed. note: microcipcip last edited this post 15 years ago.]
      • 3749
      • 24,544 Posts
      Do you mean the eForm language files? They should probably just be encoded as UTF-8 to begin with. That's generally true of non-English add-on language files.

      Most good editors will let you set the encoding of specific files.
        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
        • 19369
        • 1,098 Posts
        Yes I meant the eForm language files. I had my page set as UTF-8 (in the metatag), and when I tried to send the form, the special characters in the errors text were not correct.

        Anyway the code above was the fastest way to fix this issue.
          • 38733
          • 22 Posts
          This fixed it for me too, thanks much, and it's another fix that really needs in eForm permanently.