- Timestamp:
- 2011-02-07T23:24:37Z (14 years ago)
- Branches:
- master
- Children:
- d5a66f8
- Parents:
- c899eb0
- git-author:
- Philippe Crama <pcfeb0009@…> (07-02-11 23:24:37)
- git-committer:
- Miklos Vajna <vmiklos@…> (07-02-11 23:24:37)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skyped.py
rc899eb0 r3423be0 237 237 msg_text = [msg_text] 238 238 for i in msg_text: 239 # use utf-8 here to solve the following problem: 240 # people use env vars like LC_ALL=en_US (latin1) then 241 # they complain about why can't they receive latin2 242 # messages.. so here it is: always use utf-8 then 243 # everybody will be happy 244 e = i.encode('UTF-8') 239 try: 240 # Internally, BitlBee always uses UTF-8 and encodes/decodes as 241 # necessary to communicate with the IRC client; thus send the 242 # UTF-8 it expects 243 e = i.encode('UTF-8') 244 except: 245 # Should never happen, but it's better to send difficult to 246 # read data than crash because some message couldn't be encoded 247 e = i.encode('ascii', 'backslashreplace') 245 248 if options.conn: 246 249 dprint('<< ' + e) … … 260 263 return 261 264 try: 262 encoding = locale.getdefaultlocale()[1] 263 if not encoding: 264 raise ValueError 265 e = msg_text.decode(encoding) 266 except ValueError: 265 # Internally, BitlBee always uses UTF-8 and encodes/decodes as 266 # necessary to communicate with the IRC client; thus decode the 267 # UTF-8 it sent us 267 268 e = msg_text.decode('UTF-8') 269 except: 270 # Should never happen, but it's better to send difficult to read 271 # data to Skype than to crash 272 e = msg_text.decode('ascii', 'backslashreplace') 268 273 dprint('>> ' + e) 269 274 try:
Note: See TracChangeset
for help on using the changeset viewer.