Issue 92: Unable to decode input data. Tried the following encodings: 'utf-8', 'cp1251'.
Status:  Fixed
Owner:
Closed:  Jan 2008
Reported by jadest...@gmail.com, Dec 15, 2007
Posted by guest at 2007-11-15 10:18:21

Hi! Problem with russian. In config.xml language set is cp1251. Start
PyICQt and
connect it to OpenFire [Jabber] as module icq-gate. First time all was
good. But
now, when chat-client try connect to my server I get offline messages &
error:

Unable to decode input data.  Tried the following encodings: 'utf-8', 'cp1251'

& PyICQt console wrote: 

This script is deprecated and will vanish in a future version.
PyICQt should be started with: python PyICQt.py
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line
53, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line
38, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py",
line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py",
line 37, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File
"/usr/lib/python2.5/site-packages/twisted/internet/pollreactor.py",
line 164, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py",
line 348, in doRead
    return self.protocol.dataReceived(data)
  File "/apps/openfire/icqgate/src/tlib/oscar.py", line 647, in
dataReceived
    state=func(flap)
  File "/apps/openfire/icqgate/src/tlib/oscar.py", line 764, in
oscar_Data
    func(snac)
  File "/apps/openfire/icqgate/src/tlib/oscar.py", line 1647, in
oscar_15_03
    umessage, encoding =
guess_encoding(v[24:24+messagelen-1],self.defaultEncoding)
  File "/apps/openfire/icqgate/src/tlib/oscar.py", line 231, in
guess_encoding
    % ', '.join([repr(enc) for enc in encodings if enc]))
<type 'exceptions.UnicodeError'>: Unable to decode input data.  Tried the
following encodings: 'utf-8', 'cp1251'.

& chat-client disconnect from server =(.

Please help.
Jan 12, 2008
Project Member #1 volk...@gmail.com
This may be fixed by the latest "don't crash on weird encoding" patches.
Status: Fixed