Results 1 to 2 of 2

Thread: [RESOLVED] Ascii value from input seems incorrect

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2001
    Posts
    574

    Resolved [RESOLVED] Ascii value from input seems incorrect

    Hello,

    I am trying to read information from the system.in. That works now. But now I am stumbling upon a nxt problem. Does the system.in not support higher ascii values or so?

    I want to get the ascii value from the last character from the input. So I do this:

    Code:
    strG = scanner.next();
    iL = strG.codePointAt(strG.length()-1);
    System.out.println( iL );
    Now this seems to work with normal characters. But if I insert for instance ascii value 170 or so into it (Alt+0170) then it seems to be correct in the console but it always prints 65533, which is incorrect. Anyone have any idea why those higher ascii values are not shown correctly?

    (ps: Do I have to set some switch to accept ANSI or so?)

    /update (until ascii 126 works, 127 gives no data, everything above 128 gives 65536)
    Last edited by jacsoft; Oct 4th, 2009 at 07:30 AM. Reason: update
    Don't Hate Me Cause You Ain't Me

Posting Permissions

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



Click Here to Expand Forum to Full Width