The problem with strings decoding (Python)
There is a server written in C++ by another developer using ICE 3.7
I do not have the source code of the server, therefore it is impossible to change something in server code.
I am writing a client program in Python. My program get data from server for further work.
I get data using the ice interface in string format.
This is where i have a problem. The server does not write data for the client using utf-8, but uses Winsows-1251.
Because in the received data present the characters of the national alphabet, an exception occurs when decoding in the Python client program
('utf-8' codec can't decode byte 0xd1 in position 3: invalid continuation byte)
Here is the code of functions automatically generated in the Python module using slice2py:
def moduleInfo (self, type, uid, context=None): return _M_Server.Server._op_moduleInfo.invoke(self, ((type, uid), context)) Server._op_moduleInfo = IcePy.Operation('moduleInfo', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, None, (), (((), _M_Server._t_ModuleType, False, 0), ((), IcePy._t_int, False, 0)), (), ((), IcePy._t_string, False, 0), ())
Is it possible to somehow specify the encoding, in which the server sends data, in the client function?
Thanks for your answers.