gbishop / outfox

Automatically exported from code.google.com/p/outfox
Other
1 stars 0 forks source link

utf-8 conversion in extension #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
JavaScript uses unicode strings. They get sent from extension to server as
bytes. On the server side, the socket handler treats the results as raw
bytes (buffers or plain strings). They need to get converted to Python
unicode strings in order to work with simplejson.

Either we utf-8 encode before shipping unicode through the socket or we
figure out how to decode the raw bytes arriving at the server into Python
unicode objects.

Original issue reported on code.google.com by c...@unc.edu on 30 Jul 2008 at 2:05

GoogleCodeExporter commented 9 years ago

Original comment by c...@unc.edu on 30 Jul 2008 at 11:19

GoogleCodeExporter commented 9 years ago
Extension must convert outgoing unicode json to utf-8. Python servers receive
short-char strings / buffers. simplejson decodes utf-8 to unicode. Extension 
must
convert incoming messages from utf-8 to unicode.

The extension uses the Mozilla scriptable unicode converter service to do the
encoding and decoding.

Original comment by c...@unc.edu on 1 Aug 2008 at 12:03