×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Question Question about returned code...

    I'm creating an app that returns some data like '\x02\x00\x01...'. I've tried making it into utf-8 code but it says the data is a list

    But when I try data.split('\'), it tells me wrong token. Any idea please guys? I have this last thing to finish a program I am making

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Tempe, AZ
    Posts
    411

    Re: Question about returned code...

    Hi Dansco,
    The split part of your question is tricky a bit, i tried the same thing you told ya we do get error, but thats because "\" is a backslash in python,
    so split this thing i think you can do something like

    Code:
    abc=""
    i=0
    while(data[i]!='\\'):
    	abc+=ad[i]
    	i=i+1
    Forum makes me familiar with so many things i just overlook!
    IDEAS is all they need but still they think only Genius can give them that.

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Question about returned code...

    Quote Originally Posted by Dansco View Post
    I'm creating an app that returns some data like '\x02\x00\x01...'. I've tried making it into utf-8 code but it says the data is a list
    That looks like hexadecimal data, which is usually used to transfer binary data in text format. Or is it unicode text? Anyway, it's your app, returning data you sent, so just reverse the encoding

    You don't need the backslash nor x character. Replace them with nothing and then read and process the remaining long text string two numbers at a time.

    Cheers,

    --jouni

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: Question about returned code...

    Ah that might be why I can't split the '\', I'll try '\\'... Thanx mate

  5. #5
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: Question about returned code...

    Well after nearly 5 hours last night, I solved my problem and by total mistake - I put the code wrong and it worked lol!

    Thanx for your help guys

Similar Threads

  1. Automatic code signing for open source J2ME Apps?
    By gagravarr in forum Series 40 & S60 Platform Feedback Archive
    Replies: 3
    Last Post: 2008-05-12, 06:09
  2. Replies: 7
    Last Post: 2008-05-01, 08:26
  3. Replies: 3
    Last Post: 2006-09-05, 08:29
  4. Code Optmization Question
    By Spider_Eg in forum Mobile Java General
    Replies: 2
    Last Post: 2006-04-05, 12:35
  5. problem with Nokia Toolkit 3.1 and binary code for MMS
    By alinesimon in forum General Messaging
    Replies: 1
    Last Post: 2002-08-09, 06:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×