- Issue created by @lawxen
- Assigned to arunkumark
- Issue was unassigned.
- 🇮🇳India arunkumark Coimbatore
@Lawxen,
The issue is not because of the Drupal core. It was a common database error in the Chinese language. Please refer to the SQL Collation utf8_general_ci settings.I have resolved the issue by running the below queries into the Database server.
ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE config CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
After running this script, I was able to successfully run the Chinese words.
- 🇨🇳China lawxen
@arunkumark thanks for the review:
I retest the problem:
1. Create db by official drupal doc : create-a-database →
2. Install Drupal throug browser /core/install.php
3. Check that the config table's CHARACTER is utf8mb4 and COLLATE is utf8mb4_general_ci
4. The problem still exist.
5. Has confirm that the problem didn't exist on Drupal8 and Drupal9
So this is still a bug of core.
- 🇨🇳China lawxen
No matter which command be used to create database;
CREATE DATABASE d10 CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE DATABASE d10 CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE DATABASE d10 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
The site install will install all tables with utf8mb4 and utf8mb4_general_ci.
And execute command from arunkumark on #4 🐛 \Drupal::entityTypeManager()->getStorage('user_role')->load() can't load non-english string Active
ALTER TABLE config CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
\Drupal::entityTypeManager()->getStorage('user_role')->load("中文");
can be executed successfully.
This is wiard, But comfim this is a regression of Drupal 10.
- 🇺🇸United States cilefen
Those character sets and collations are defaults for new tables. Drupal may deliberately set other character sets and collations, like ascii_general_ci, for some tables. I think that is the case here, and with some queries, when joining tables with differing collations, this can occur.
- 🇹🇷Turkey makbay
I can also confirm that this happens for Turkish characters.
All of my tables and database are collated as utf8mb4_general_ci
Just came here from: https://www.drupal.org/project/webform/issues/3415445 🐛 Search Chinese in /admin/structure/webform cause error: Illegal mix of collations Closed: duplicate
- 🇫🇮Finland konstara Helsinki
Workaround where no collation changes are required.
- 🇫🇮Finland konstara Helsinki
https://www.drupal.org/files/issues/2024-02-26/3415478-cant-load-non-eng... →
Created this for workaround where no collation changes are required.