bugThe Circle - Bugs: bug #3830, Bad string->unicode conversions

 
 

bug #3830: Bad string->unicode conversions

Submitter:  Peter Moulder <pjrm>
Submitted:  Sat 31 May 2003 07:48:30 AM UTC
   
 
Category:  * Graphical version (circle) Severity:  4
Item Group:  * Bug Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 31 May 2003 07:48:30 AM UTC, original submission:  

An example of how to trigger this bug is to send some 8-bit text from a gtk1 client to a gtk2 client.
(I'd guess that another example is to send some 8-bit gossip text, etc.: grep force_unicode *y.)

Under the gtk2 client, sys.getdefaultencoding() is returning 'utf-8'.  This is used by settings.terminal_encoding, which in turn is used by force_unicode and force_string.

pfh's suggested fix is to set settings.terminal_encoding to 'CP1252' unconditionally.  However, he notes that doing so triggers "Augmentation of wrong length" errors.  Pfh says this is a separate bug, where augmentation length is number of bytes (presumably of utf-8 encoding) rather than number of characters.

Ryan says that fixing this bug (for the chat message case) also requires the following change:
             # Legacy message format
-            text = request[3]
+            text = utility.force_unicode(request[3])

Peter Moulder <pjrm>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code