2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Pass message as a unicode object, to avoid encoings getting screwed up

This commit is contained in:
2013-12-07 15:35:55 -08:00
parent a0329523db
commit 324715db9d

View File

@ -2162,11 +2162,13 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
} }
plProfile_BeginTiming(PythonUpdate); plProfile_BeginTiming(PythonUpdate);
plStringBuffer<wchar_t> wMessage = pkimsg->GetString().ToWchar();
PyObject* uMessage = PyUnicode_FromWideChar(wMessage, wMessage.GetSize());
PyObject* retVal = PyObject_CallMethod( PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_RTChat], fPyFunctionInstances[kfunc_RTChat],
(char*)fFunctionNames[kfunc_RTChat], (char*)fFunctionNames[kfunc_RTChat],
"Osl", player, pkimsg->GetString().c_str(), "OOl", player, uMessage, pkimsg->GetFlags());
pkimsg->GetFlags()); Py_DECREF(uMessage);
if ( retVal == nil ) if ( retVal == nil )
{ {
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE