Answer the question
In order to leave comments, you need to log in
Can't figure out what's wrong with encodings or what's going on in python at all?
vk bot returns the result {body: somedata }
if the result of the body variable is output to the console, it gives the
following u'\u043f\u0440\u0438\u0432\u0435\u0442'
how to convert it into a readable form??
I thought that chatterbot does not accept the Cyrillic alphabet, but there is support for it, as I understand it.
tried like this
#if isinstance(msg, unicode):
# message = msg.encode('utf8')
#message = u''.join(msg.encode('ascii', 'ignore').decode('ascii'))
#pprint(message)
msg.encode('utf8').decode('utf8')
Answer the question
In order to leave comments, you need to log in
It all depends on the encoding in the console. On MS Windows, this is CP866
. But I suspect that this is caused by a feature of object serialization:
how to turn off data serialization? I'm new to python, as I understand it, serialization is a bunch of variables thrown off into one variable ???
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question