Changeset a75f2a7


Ignore:
Timestamp:
2007-10-06T15:35:55Z (17 years ago)
Author:
VMiklos <vmiklos@…>
Branches:
master
Children:
2d07803
Parents:
3922d44
Message:

display received messages in utf8, so that we can avoid most UnicodeEncodeErrors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skype/skyped.py

    r3922d44 ra75f2a7  
    103103                        msg_text = [msg_text]
    104104                for i in msg_text:
    105                         e = i.encode(locale.getdefaultlocale()[1])
     105                        # use utf-8 here to solve the following problem:
     106                        # people use env vars like LC_ALL=en_US (latin1) then
     107                        # they complain about why can't they receive latin2
     108                        # messages.. so here it is: always use utf-8 then
     109                        # everybody will be happy
     110                        e = i.encode('UTF-8')
    106111                        dprint('<< ' + e)
    107112                        if conn:
     
    109114                                        conn.send(e + "\n")
    110115                                except IOError, s:
    111                                         dprint("Warning, seding '%s' failed (%s)." % (e, s))
     116                                        dprint("Warning, sending '%s' failed (%s)." % (e, s))
    112117
    113118        def send(self, msg_text):
     
    121126                        pass
    122127                except Skype4Py.SkypeAPIError, s:
    123                         dprint("Warning, seding '%s' failed (%s)." % (e, s))
     128                        dprint("Warning, sending '%s' failed (%s)." % (e, s))
    124129
    125130class Options:
Note: See TracChangeset for help on using the changeset viewer.