sbpp / sourcebans-pp

Admin, ban, and comms management system for the Source engine
https://sbpp.github.io/
Creative Commons Attribution Share Alike 4.0 International
335 stars 174 forks source link

Verify Insert Query Failed: Incorrect string value #339

Closed Aftermoon-dev closed 7 years ago

Aftermoon-dev commented 7 years ago

Expected Behavior

Ban Register in SourceBans Website, And DB

Current Behavior

Try In-Game Ban include Korean Reason, but can't register ban in Database (If Reason Write English, I can add ban.) sourcebans.log Error : L 08/14/2017 - 13:06:26: [sbpp_main.smx] Verify Insert Query Failed: Incorrect string value: '\xED \x85 \x8C ...' for column 'reason' at row 1 (I'm Korean, So Our Server's Ban Reason is Korean Lanaguage)

Possible Solution

Steps to Reproduce (for bugs)

  1. Ban Player include Korean Language Reason (ex. 테스트)
  2. Can't find Ban Infomation.
  3. sourcebans.log : L 08/14/2017 - 13:06:26: [sbpp_main.smx] Verify Insert Query Failed: Incorrect string value: '\xED \x85 \x8C ...' for column 'reason' at row 1

Context

I'm Korean So We need Korean Reason, but We can't add Ban include Korean Language Reason. I change MySQL characterset Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4

But Nothing Change. We still can't ban user.

Your Environment

rumblefrog commented 7 years ago

Can you provide the plugin source where you modified the charset and did you change table collate?

Aftermoon-dev commented 7 years ago

I'm not change plugin source. Same Source for 1.6.2. And I already change table collate (utf8mb4_general_ci)

rumblefrog commented 7 years ago

If you didn't change the source, how did you change the client charset?

Aftermoon-dev commented 7 years ago

I change MySQL Setting File.

rumblefrog commented 7 years ago

Try modifying the sbpp_main.sp on https://github.com/sbpp/sourcebans-pp/blob/ad62c907fb720b41c0c8578ee34de45ae289466f/game/addons/sourcemod/scripting/sbpp_main.sp#L1003

sarabveer commented 7 years ago

Also, use utf8mb4_unicode_ci

Aftermoon-dev commented 7 years ago

Thanks For Answer. I try test now.

Aftermoon-dev commented 7 years ago

I change table's collations to utf8mb4_unicode_ci And I change plugins source in line 1003 -> SQL_SetCharset(DB, "utf8mb4"); Same Error [sbpp_main.smx] Verify Insert Query Failed: Incorrect string value: '\xE3 \x85 \x81 ...' for column 'reason' at row 1

Aftermoon-dev commented 7 years ago

This Error is Maybe SourceMod can't support Unicode Text.

CrazyHackGUT commented 7 years ago

SourceMod (and DBI, MySQL extensions) supports Unicode text. The problem is in the MySQL Server configuration.

Aftermoon-dev commented 7 years ago

But I try use this code, I can't See Korean Character in Chat. And, Another DB can write data include Korean Character. I ask to other Korean CS:GO Server Master, They answered to me, Our Server's SourceBans can write Korean Character. (They are use Windows) I use Newest Stable MetaMod, And SourceMod, Sourcebans++. I think it is very Strange :(


#include <sourcemod> 

public OnPluginStart()
{
    RegAdminCmd("sm_testcmd", Test_Command, ADMFLAG_BAN, "sm_ban <#userid|name> <minutes|0> [reason]");
}

public Action:Test_Command(client, args)
{
    decl String:buffer[100];
    GetCmdArg(1, buffer, sizeof(buffer));
    PrintToChatAll("Buffer : %s", buffer);
    return Plugin_Handled;
}
``
CrazyHackGUT commented 7 years ago

You entered "Korean character" in quotes? sm_testcmd "your korean character"

Aftermoon-dev commented 7 years ago

CS:GO In-Game Chat can't write quotes.

CrazyHackGUT commented 7 years ago

In some source games (TF2, for example) too. Use console.

Aftermoon-dev commented 7 years ago

Console can't type korean (but copy & taste can see Korean in PrintToChat)