Closed muukis closed 4 years ago
@muukis Sorry for the late response. I just tested that code, but I wasn't able to reproduce the issue:
#include <sourcemod>
#include <ripext>
public void OnPluginStart()
{
JSONObject obj = new JSONObject();
obj.SetString("test", "ð");
char test[10];
obj.GetString("test", test, sizeof(test));
delete obj;
PrintToServer("Test %s", test); // Output: Test ð
}
Both of your examples from the AlliedModders thread worked for me as well.
If you're still having this issue, could you provide the extension version, SourceMod version, and which game you're running it on?
Using special characters on SetString fails, or at least GetString cannot find the set key. I posted the issue also to AlliedModders thread.
Here's an example: `JSONObject obj = new JSONObject(); obj.SetString("test", "ð");
decl String:test[10]; obj.GetString("test", test, sizeof(test));
[SM] Native "JSONObject.GetString" reported: Could not retrieve value for key 'test'`