Browse Source

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

Michael Hansen 11 years ago
parent
commit
324715db9d
  1. 6
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

6
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

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

Loading…
Cancel
Save