Added SQL_SetCharset native to (re)set character set (bug 5999, r=ds).

This commit is contained in:
Arkshine
2014-04-18 22:04:32 +02:00
parent 19e160117f
commit 3d732bbbb6
12 changed files with 94 additions and 1 deletions

View File

@ -137,6 +137,13 @@ namespace SourceMod
* on internal failure.
*/
virtual int QuoteString(const char *str, char buffer[], size_t maxlen, size_t *newsize) =0;
/**
* @brief Sets the character set of the current connection
*
* @param characterset The characterset to switch to. e.g. "utf8".
*/
virtual bool SetCharacterSet(const char *characterset) =0;
};
struct DatabaseInfo
@ -148,6 +155,7 @@ namespace SourceMod
const char *pass;
unsigned int port;
unsigned int max_timeout;
const char *charset;
};
class ISQLDriver

View File

@ -78,3 +78,9 @@ int SqliteDatabase::QuoteString(const char *str, char buffer[], size_t maxlen, s
return 0;
}
bool SqDatabase::SetCharacterSet(const char *characterset)
{
// sqlite only supports utf8 and utf16 - by the time the database is created. It's too late here.
return false;
}

View File

@ -22,6 +22,7 @@ namespace SourceMod
IQuery *PrepareQueryFmt(const char *fmt, va_list ap);
IQuery *PrepareQuery(const char *query);
int QuoteString(const char *str, char buffer[], size_t maxlen, size_t *newsize);
bool SqDatabase::SetCharacterSet(const char *characterset);
private:
void Disconnect();
private: