Raised This Month: $51 Target: $400
 12% 

Bug Report utf name mangling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bottiger
AlliedModders Donor
Join Date: Dec 2010
Old 11-11-2014 , 20:36   utf name mangling
Reply With Quote #1

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.
__________________

Last edited by bottiger; 11-13-2014 at 14:48.
bottiger 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 07:54.


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