On 3/17/13 9:20 PM, Don Dwiggins wrote:
I'm developing a small pyjs application, which gets data from aURL and allows displaying it in various ways. The application uses HTTPRequest().asyncGet in the main section, and does most of its processing in the onCompletion handler. It works beautifully using pyjd, however...
I've started using Firebug to get a clearerpicture of what's going on. The request completes, and the onCompletion method is called; so far, so good.

The data that I'm getting in the request is aUnicode representation of a csv file. I have the line:

    csvlines = csvdata.encode('utf-8').split('\n')

to convert the string to utf-8 and turn it into a list of lines. The error I get in the JS is:

TypeError: csvdata.encode is not a function
return csvdata['encode']('utf-8');

At this point, I'm not sure how to proceed. Does this mean that pyjs doesn't have the equivalent of a string method called "encode"? Or is there something else going on? If the former, is there an alternate way to accomplish what I'm trying to do?

(BTW, the programworks well under pyjd.)


TIA,
Don

--

--- You received this message because you are subscribed to the Google Groups "Pyjs.org Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to