I decided to investigate why sourcebans mangles utf names even though it does "SET NAMES UTF8"
It appears to be the lack of SQL_SetCharset. This does not only set the charset on reconnect, but it also makes EscapeString behave properly. I am not sure if this needs to be done for SQLite as well.
Is this fixed by setting SQL_SetCharset on connection like it is done in Sourcebans 2.0? Unfortunately not without some serious side-effects.
If you execute SQL_SetCharset after connection, it will execute mysql_set_character_set without any threading at all, causing it to block.
https://github.com/alliedmodders/sou...base.cpp#L1424
https://github.com/mysql/mysql-serve...client.c#L5750
- Set the default charset to utf8 inside TConnect
- A threaded version of SQL_SetCharset
- Make a function to set mysql->charset and not execute a request.
UPDATE
The only way to fix this is to edit the C++ extension.
It turns out that reconnects are enabled and if it reconnects in the background, then you won't get a chance to execute SET NAMES UTF8. So mysql_set_character_set must be used.
__________________