AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved MySql Special Caracters Store Problem (https://forums.alliedmods.net/showthread.php?t=325141)

kratoss1812 06-09-2020 14:31

MySql Special Caracters Store Problem
 
Hello,

If I store a string that contains a special caracter ( such as ✰⋆🌟✪🔯✨ ) intro a mysql database it will be stored as " ? "
For example " ✰✰ Special String ✰✰ " Will be stored as " ?? SpecialString ?? "

How can I fix that?

NomisCZ 06-09-2020 17:09

Re: MySql Special Caracters Store Problem
 
Hi,
use utf8mb4 char set and utf8mb4_unicode_ci collation.

https://www.eversql.com/mysql-utf8-v...8-and-utf8mb4/

kratoss1812 06-10-2020 07:44

Re: MySql Special Caracters Store Problem
 
Quote:

Originally Posted by NomisCZ (Post 2704847)
Hi,
use utf8mb4 char set and utf8mb4_unicode_ci collation.

https://www.eversql.com/mysql-utf8-v...8-and-utf8mb4/

Thank u for your response. Could you give me an exmaple how i could use this in a query? My MySQl knowlege are few.

Edit: I didn't saw the link u atached. Thank u

Cruze 06-14-2020 13:57

Re: MySql Special Caracters Store Problem
 
You can take help from this code: https://github.com/Sples1/ENT_FirstJ...t_firstjoin.sp

kratoss1812 06-15-2020 09:11

Re: MySql Special Caracters Store Problem
 
Quote:

Originally Posted by Cruze (Post 2705666)

neah i got it thanks anyway

here is the code if anyone is having the same issue as me
PHP Code:

        kQuery(g_hDataBase"CREATE TABLE IF NOT EXISTS `tags` (`steamid` varchar(32) PRIMARY KEY NOT NULL, `chat_tag` varchar(128), `tab_tag` varchar(128));""ConnectToDataBase[0]");
        
kQuery(g_hDataBase"ALTER TABLE tags CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;""ConnectToDataBase[3]"); 


Peace-Maker 06-15-2020 10:56

Re: MySql Special Caracters Store Problem
 
Don't forget to call SQL_SetCharset(g_hDataBase, "utf8mb4"); too!


All times are GMT -4. The time now is 13:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.