• Resolved bglaettli

    (@bglaettli)


    Since upgrading to the new (and performancewise great!!) version of the plugin, I have the problem, that umlaut-characters (?, ?, ü etc.) are no longer shown correctly.

    See an example on https://www.akw-nein.ch/2011/03/die-unterzeichnenden/
    I am using the new cfdb-html tag:

    [cfdb-html form=”Kontaktformular_02″ show=”your-firstname,your-name,your-ort” filter=”menu-anonym=Name anzeigen ok” orderby=”Submitted desc”] ${your-firstname} ${your-name}, ${your-ort}; [/cfdb-html]

    best regards
    balthasar gl?ttli
    My configuration:
    I am using WordPress 3.1 de_DE
    PHP/5.2.12 with Suhosin-Patch
    MySQL-Client-Version: 5.1.42
    PHP Erweiterung: mysqli

    MySQL Server Version: 5.1.51-log
    Protokoll-Version: 10
    MySQL-Character Setting: UTF-8 Unicode (utf8)

    https://www.ads-software.com/extend/plugins/contact-form-7-to-database-extension/

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    I tried a simple example on my test site using umlaut-characters and [cfdb-html] and it looks OK….

    When you look at the admin Database page, does the data show correctly? If not, I wonder if your form is not capturing the input data in UTF-8.

    I put in a fix that might be related to your issue. Try uploading the current development version. (Do NOT uninstall).

    Thread Starter bglaettli

    (@bglaettli)

    Thanks for your very fast response!

    1. In the Admin Database Page, the data looks scrambled too.
    2. I’ll try to install your fix today and give you a feedback
    3. regarding your remark about the form eventually “not capturing the input data in UTF-8″, where would I have to configure this correctly? The Page in which the form is embedded, has the code <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ /> in it’s header.

    I’m having the same problem that umlaut-characters (?, ?, ü etc.) are not shown correctly. Special chars are messed up in the front-page using shortcodes, messed up in the backend db view and when i open up phpmyadmin they look messed up there too.

    On the page where form gets submitted, the html encoding is utf-8.

    But.. as the WP installation dates back to who-knows-when, the mysql database has latin1_swedish_ci collation. Bglaettli, can you confirm that you have the same collation?

    Now i changed wp_CF7DBPlugin_SUBMITS table’s collation to utf-8 and individual text fields in that table were utf-8 already. Inserted new data through form but still same issue – special chars messed up in the db. So i changed everything to latin1 and again submitted data thru form but still messed up.

    I guess it’s that collation/charset thing that i never really have gotten time to clarify to myself ??

    Help and hints appreciated.

    Plugin Author Michael Simpson

    (@msimpson)

    Are you using Contact Form 7 or FSCF?

    Is the page that contains the form in UTF-8? If not, what is the encoding?

    When you get an email after someone submits a form, do you see correct umlaut characters in the email?

    Using Contact Form 7. Page that contains the form is in UTF-8 encoding (html meta). Umlaut characters in the e-mail show correct also.

    Thread Starter bglaettli

    (@bglaettli)

    @michael et. al.

    1. I am using contact form 7
    2. page that contains the form (and the one with the output) ist in UTF-8 Encoding:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    3. Umlaut characters in the confirmation mails look correct.
    4. Table wp_CF7DBPlugin_SUBMITS has collation utf8_unicode_ci
    5. I am using the following shortcodes [cfdb-html form=”Contact form 1″ show=”your-firstname,your-lastname,your-zipplace” orderby=”your-lastname asc”] ${your-firstname} ${your-lastname}, ${your-zipplace}; [/cfdb-html]

    It still shows up weird: Z??rich instead of Zürich etc.

    Plugin Author Michael Simpson

    (@msimpson)

    Do these line appear in your WP installations’s wp-config.php file?

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');

    I’m having trouble working out this problem mainly because I can’t reproduce it. Searching the net, it looks like some people have cases where their MySQL is set to UTF-8 but the input connection assumes latin1 and these characters get scrambled (unrelated to WP). I infer from the WP documentation on setting charset, the above should make the connections be UTF-8.

    Plugin Author Michael Simpson

    (@msimpson)

    Also, is your version of PHP less than 5.2.3? If you go to the Database Options page, it prints the PHP and MySQL versions.

    Thread Starter bglaettli

    (@bglaettli)

    Dear Michael

    Your guess related to the input connection seems to go in the right direction. I added the recommended settings into my wp-config.php file:

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');

    After that, in the rest of my blog, all Umlaut characters were displaying scrambled as well! However, the Form results on the other hand did not repair themselves. So I guess, I will try to follow this path myself… Obviously, my connection is not assuming UTF-8.

    Plugin Author Michael Simpson

    (@msimpson)

    Check one thing: make a new form submission and see if that appears correctly. You might have this problem fixed but only for all present/future form submissions.

    You might then try to fix existing entries in the database by exporting the wp_CF7DBPlugin_SUBMITS table from MySQL, editing the export file to replace incorrect characters, rename the wp_CF7DBPlugin_SUBMITS table to make a back it up, and import the corrected import file. Note: some others have reported that when they export and import, the ‘file’ field that is null prior to export is a zero-length non-null after re-import and that caused problems. The fix to that is to run this query after import: update wp_CF7DBPlugin_SUBMITS set file = NULL where length(file) = 0

    Plugin Author Michael Simpson

    (@msimpson)

    More on exports, another user reports having issues re-importing but this process worked for him:

    1. Export the database from the table
    2. Drop the table from the database (** I suggest rename it **)
    3. Uninstall the plugin within wordpress (deactivate and delete)
    4. Reinstall the plugin
    5. Open the exported sql file and remove the first block that recreates the table
    6. Save the edited SQL file and import into mysql

    I’m having pretty much exactly the same problem.

    Some characters are getting corrupted when going into the database (e.g., an apostrophe likely copied / pasted in from Word is my guess during a contact 7 form submission). The characters look fine in the email that gets sent, but in the database they are not correct.

    I thought this was likely some UTF-8 character encoding issue. I’ve recreated by submitting ?, ?, ?, ?, ü, ü, ? as part of a test form submission. These again are correct in the email, but wrong (??, ?¤, ?–, ??, ??, ??, ??) in the database.

    My php database columns are confirmed to be: utf8_general_ci

    WordPress 3.2.1
    PHP Version 5.2.17
    MySQL Version 5.1.53-log

    I looked at my wp-config.php and tried entering the following (this was not there at all):

    /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);

    This caused a bunch of errors / miscodings on existing posts in the website so I quickly undid that change.

    Interestingly I can go into the contact form 7 db table directly using phpmyadmin and in the same row where my original umlaut characters are munged, I can paste in the original umlaut characters and they do NOT get garbled.

    Seems like there is some issue between the capturing of the data in the form (after the email is sent with the form values) and prior to the insert into the database table where the character encoding is going awry.

    Plugin Author Michael Simpson

    (@msimpson)

    Would you be willing to set up a test WP site with the plugin and a form that demonstrates this, then give me a WP admin login so I can play around with the plugin code on that site? I have not been able to duplicate this issue and I need and environment where I can try to figure out what is going on.

    Hi Michael,

    I managed to set up a debug site. How can I start communicating with you directly to give you access instructions?

    I really appreciate your help! (as does my daughter’s PTA – whose WordPress website I’m helping out with)

    Thanks,
    Dana

    Plugin Author Michael Simpson

    (@msimpson)

    Got your email!

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Plugin: Contact Form 7 to Database Extension] Problems with Umlaut-Characters (?, ?, ü, é , à’ is closed to new replies.