×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    lost words in InputStreamReader

    Hello
    I wrote this Demo code in netbeans for j2me app. this code recieve some string from servlet.
    The problem is I couldn't recieve complete string and I lost Some words in recieved text . the code is here .
    Please do your Best.


    DataInputStream is =(DataInputStream)c.openDataInputStream();
    InputStreamReader input = new InputStreamReader(is,"UTF-8");

    int ch;
    sb = new StringBuffer();
    while ((ch = input.read()) != -1) {

    sb.append((char)ch);
    }

    showAlert(sb.toString());
    is.close();
    c.close();
    } catch (Exception e) {
    showAlert(e.getMessage());

    }

  2. #2
    Regular Contributor
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343

    Re: lost words in InputStreamReader

    I dont think so there is problem in your code can you please tell me what string you are reading from the server.Hey you can try to Read from other method then check whther its giving problem or not.If you dont know about any other method i can help you
    Anshu Chauhan
    J2me Developer

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    Re: lost words in InputStreamReader

    For Example When I typed in arabic مهدی شجاعیان زنجانی in servlet , i recieve مهدی شجاعی in j2me app . But ii's not happen when type in English .
    Where is the problem?

  4. #4
    Regular Contributor
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343

    Re: lost words in InputStreamReader

    Here i got problem your are reading different character thats why reading gives you problem you can,t convert these in character and append this on StringBuffer. am not sure but in my experience this is not possible
    Anshu Chauhan
    J2me Developer

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    Re: lost words in InputStreamReader

    So What Should I do?

  6. #6
    Regular Contributor
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343

    Re: lost words in InputStreamReader

    Just Read About Localization in J2me I am Sure you will get your answer
    Anshu Chauhan
    J2me Developer

Similar Threads

  1. HTTP Connection behaviour when 3G connection is lost (or being lost)
    By TwmD in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2010-01-27, 12:36
  2. InputStreamReader reset() doesn't work?
    By ninku6a in forum Mobile Java General
    Replies: 1
    Last Post: 2006-05-14, 12:05
  3. InputStreamReader hangs on S60...
    By proxima1 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-12-17, 11:24
  4. problem in j2me inputStreamReader
    By kmsoomro in forum Mobile Java General
    Replies: 2
    Last Post: 2005-05-30, 06:00
  5. inputStreamReader hangs on some nokia
    By fkadm01 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-04-11, 09:03

Posting Permissions

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