Hello. I have following table
PHP Code:
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
After creating db tuple, I call SQL_SetCharset with value "utf8mb4".
PHP Code:
_dbh = SQL_MakeDbTuple(host, user, pass, db);
is_success = SQL_SetCharset(_dbh, "utf8mb4");
server_print("[%f] [SQL_SetCharset] is_success: %d", get_gametime(),
is_success);
It works perfect on my local machine but remote one - all Cyrillic letters are replaced with question marks. Does anyone know why?
Local machine
Linux distro: Arch Linux
Database: mariadb from 11.1.2-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1
Remote machine
Linux distro: Debian 11
Database: mariadb Ver 15.1 Distrib 10.5.21-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
A few more words about the issue. For example, I have nickname "Привет".
PHP Code:
| Local machine | Remote machine
without SQL_SetCharset | Привет | Привет
with SQL_SetCharset | Привет | ??????
SQL_SetCharset returns | 1 | 1
It seems that code parser replaces first Cyrillic letter with html code.
Well, I can remove SQL_SetCharset and then it would work on remote machine, but my test environment becomes broken. Also I want to know the reason why encoding on debian is forced without SQL_SetCharset call?