#2611 BLOC Trial-2: Accented characters cause a sugar crash.

Zarro Boogs per Child bugtracker at laptop.org
Wed Aug 1 16:06:38 EDT 2007


#2611: Accented characters cause a sugar crash.
-------------------------------+--------------------------------------------
  Reporter:  cjb               |       Owner:  smcv   
      Type:  defect            |      Status:  closed 
  Priority:  blocker           |   Milestone:  Trial-2
 Component:  presence-service  |     Version:         
Resolution:  fixed             |    Keywords:  patch  
  Verified:  0                 |  
-------------------------------+--------------------------------------------
Changes (by smcv):

  * status:  reopened => closed
  * resolution:  => fixed

Comment:

 The difference was, believe it or not, that the unnecessary gtk import was
 removed from PS between 537 and 538:

 {{{20:35 < smcv> >>> import sys
 20:35 < smcv> >>> sys.getdefaultencoding()
 20:35 < smcv> 'ascii'
 20:35 < smcv> >>> import gtk
 20:35 < smcv> >>> sys.getdefaultencoding()
 20:35 < smcv> 'utf-8'
 20:35 < cjb> holy crap!}}}

 It turns out that the pango module implicitly sets the default encoding to
 UTF-8, meaning that unicode to str conversion assumes UTF-8 rather than
 ASCII.

 I believe using unicode objects is a better fix, so I'd be inclined to
 keep the fix I already checked in. Setting the default encoding is rather
 an unsubtle "fix" - it's better to differentiate between text (in unicode
 objects) and bytestrings (in str objects).

-- 
Ticket URL: <https://dev.laptop.org/ticket/2611#comment:14>
One Laptop Per Child <http://laptop.org/>



More information about the Bugs mailing list