• Resolved luisclima

    (@luisclima)


    I recently did a new wordpress installation(v5.3.2) but I’m having a hard time.
    The special and accented characters in the menu are replaced by weird characters.

    As mentioned in other topics,i made several changes to the lines
    “define (‘DB_CHARSET’, ‘utf8’)”
    “define (‘DB_COLLATE’, ”)”
    from the wp-config.php file. It did not work.
    Please help me

    Regards
    LCL

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    The charset used by the DB is a lot more complicated than changing wp-config.php. In the DB management tool phpMyAdmin the database has a charset (collation) setting, each table has a setting, and every textual column in a table has a setting. But even changing these is not enough. The data contained remains encoded as it was. Changing the encoding without changing the data will just make things worse. The only benefit will be newly entered data will then work correctly.

    Since you have a new site, I assume there is not much existing content involved. You might consider starting over as though for a fresh installation. In phpMyAdmin, drop all the WP tables. Be sure the database collation is set to ‘utf8mb4_general_ci’. Define DB_COLLATE as the same. “utf8” is correct for DB_CHARSET. Run /wp-admin/install.php again. Be sure newly created content with accented characters displays as expected before getting too involved with adding more content.

    When copy/pasting content from other sources, be sure the source is also UTF-8 encoded. If you are not sure, it’s best to paste into a plain text editor’s blank UTF-8 file first, then copy/paste that into WP.

    Thread Starter luisclima

    (@luisclima)

    Thanks for your help.
    I applied your changes to a new installation and did not correct the problem.
    I have another site where this works well and it has some tables in utf8mb4-unicode-ci and others in utf8mb4-unicode-520-ci. this website is not new and has had automatic updates.

    Moderator bcworkz

    (@bcworkz)

    Yeah, there should not be any issues if everything is UTF-8. Even when the DB collation varies, the discrepancy has more to do with properly ordering results than encoding. Are you copy/pasting text from elsewhere or do you have trouble with text that is typed directly into WP?

    Copying from elsewhere can cause issues when the source is encoded differently. Typing directly shouldn’t cause problems as long as the page you are typing into is UTF-8. Verify this by checking the page’s source HTML. Near the top of the document, after <head> there should be something like <meta charset="UTF-8" > or at least something telling the browser the charset is UTF-8.

    Same goes for the page displaying strange characters. The page you linked to in the OP is correct. It shouldn’t matter, but to rule out some potential variables, try switching to the twentytwenty theme and deactivating all plugins. Make a new menu entry and see if the problem persists. If it does, I’m leaning strongly towards something amiss with the server configuration.

    Thread Starter luisclima

    (@luisclima)

    Problem solved.
    I updated the php version to 7.4

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘weird characters on the menu’ is closed to new replies.