Raised This Month: $ Target: $400
 0% 

Custom nicknames in database


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Antosh
Junior Member
Join Date: May 2021
Old 07-27-2022 , 17:34   Custom nicknames in database
Reply With Quote #1

Hi, i have a problem with saving custom nicknames from player to database. If user has a nick like:


or


Database displays question marks.

Charset:

SQL_SetCharset(g_hDB, "utf8mb4");

how could i fix it?
Antosh is offline
L4D2Noob
AlliedModders Donor
Join Date: Mar 2020
Location: Moscow
Old 07-27-2022 , 18:11   Re: Custom nicknames in database
Reply With Quote #2

Quote:
Originally Posted by Antosh View Post
utf8mb4
Try saving nicknames in utf8mb4_bin encoding
__________________
L4D2Noob is offline
Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
Antosh
Junior Member
Join Date: May 2021
Old 07-27-2022 , 18:24   Re: Custom nicknames in database
Reply With Quote #3

Quote:
Originally Posted by L4D2Noob View Post
Try saving nicknames in utf8mb4_bin encoding
Now is:

Antosh is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-28-2022 , 05:01   Re: Custom nicknames in database
Reply With Quote #4

you nickname column should be nvarchar type as well and the database collation should allow this kind of nick name.
Did you test manually inserting the nickname in database? (SQL: INSERT <nickname> INTO table)
__________________
Marttt is offline
Antosh
Junior Member
Join Date: May 2021
Old 07-28-2022 , 07:32   Re: Custom nicknames in database
Reply With Quote #5

Now it works in db



but on website (the page retrieves data from this db) still are question marks

im using on web: <meta charset="utf-8" /> should i change it? no idea...

Last edited by Antosh; 07-28-2022 at 07:32.
Antosh is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:35.


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