V_UnicodeToUTF8
0x00049d50 · 160 bytes · __cdecl
_Z15V_UnicodeToUTF8PKwPci
Decompiled
undefined (3 params)
/* V_UnicodeToUTF8(wchar_t const*, char*, int) */
undefined4 V_UnicodeToUTF8(wchar_t *param_1,char *param_2,int param_3)
{
iconv_t __cd;
size_t sVar1;
size_t local_2c;
size_t local_28;
wchar_t *local_24;
char *local_20 [4];
if (0 < param_3) {
*param_2 = '\0';
}
if ((param_2 != (char *)0x0) && (param_1 != (wchar_t *)0x0)) {
__cd = iconv_open("UTF-8","UTF-32LE");
sVar1 = wcslen(param_1);
local_28 = param_3;
local_2c = sVar1 * 4 + 4;
local_20[0] = param_2;
local_24 = param_1;
if (__cd != (iconv_t)0x0) {
iconv(__cd,(char **)&local_24,&local_2c,local_20,&local_28);
iconv_close(__cd);
}
}
if (0 < param_3) {
param_2[param_3 + -1] = '\0';
}
return 0;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.