Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Supporter timezone: Asia/Dhaka (GMT+06:00)

This topic contains 5 replies, has 1 voice.

Last updated by Prosenjit Barman 2 weeks, 6 days ago.

Assisted by: Prosenjit Barman.

Author Posts
December 2, 2024 at 6:57 am #16464205

azimd

Background of the issue:
I imported a WPML live website into another server using 'All in one migration' and 'Wp Vivid import' plugins. The site is under development.

Symptoms:
I'm getting junk characters for some of the translated content after importing the site.

Questions:
How can we fix the junk characters issue for translated content after import?

December 2, 2024 at 12:41 pm #16466052

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hi,

thanks for contacting us. Can you see if the solutions from here help?

December 2, 2024 at 5:22 pm #16467767

azimd

i have tried this approach but didn't help.

December 4, 2024 at 6:41 am #16474432

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There!
I hope you're doing well. I've taken over this ticket and will try my best to assist you in this matter.

From the WPML Debug Info, the database `charset` is set to `utf8mb4`, and the `collation` is `utf8mb4_unicode_520_ci`, which is generally compatible with modern WordPress and WPML. However, the collation "utf8mb4_unicode_520_ci" is newer and not always supported on older servers or PHP versions. Check if the previous server (the source) was using the same collation or a different one (e.g., utf8mb4_unicode_ci or utf8_general_ci). If the collation differs, inconsistency may cause encoding issues.

Please check all the tables in the Database and set the collation for tables and columns to "utf8mb4_unicode_ci" for better compatibility.

ALTER TABLE your_table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Repeat this for all tables on the database. Please MAKE SURE to take a FULL BACKUP of the site and Database before running any database operation.

Please try and let me know how it goes. I'll be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

December 4, 2024 at 12:53 pm #16476718

azimd

Our current WordPress server configuration uses "charset": "latin1" and "collate": "latin1_swedish_ci". However, WPML and WordPress community forums recommend switching to utf8 or utf8mb4_unicode_520_ci for better compatibility with Indian languages and other non-Latin scripts. This change ensures proper rendering and support for multilingual content, particularly for characters outside the Latin set.

To resolve this, we attempted to migrate the database character set and collation to utf8mb4_unicode_520_ci (the latest version). However, the process requires a systematic approach to avoid potential data loss or corruption. Please confirm how this migration can be fully implemented and tested for optimal compatibility with WPML and Indian languages.

Let us know the exact steps or any additional considerations to ensure a smooth transition.

03.jpg
02.jpg
01.jpg
December 5, 2024 at 4:30 am #16479239

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There!
Thank you for the update.

I understand your concern. To enhance compatibility with WPML and ensure better support for Indian languages, we recommend migrating your database to the `utf8mb4` charset with the `utf8mb4_unicode_ci` collation, replacing the current Latin-based configuration. The `utf8mb4_unicode_ci` collation is highly compatible and widely supported.

I'm sharing the process below.

1. Create a full backup using phpMyAdmin, `mysqldump`, or a WordPress backup plugin.
2. Update WordPress Configuration: Modify `wp-config.php`:

   define('DB_CHARSET', 'utf8mb4');
   define('DB_COLLATE', 'utf8mb4_unicode_ci');

3. Convert Your Database: Manually update the charset and collation in Database table using the following SQL Query:

   ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

4. Verify Changes: Check that all tables and columns use the new charset and collation:

   SELECT TABLE_NAME, TABLE_COLLATION FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'your_database_name';

5. Test WPML and Site Functionality: Ensure that multilingual content displays properly and no characters are corrupted. Updating the collation should not result in any loss of content.

6. Perform the changes on a staging site first. Test thoroughly before applying them to your live site.

I hope the steps above will help to change the collation and charset properly. If you need further assistance, feel free to reach out. I'm here to assist!

Best regards,
Prosenjit

The topic ‘[Closed] When i import a WPML site to another hosting server im getting junk character for some of the transl…’ is closed to new replies.