Dealing with Unicode

Discussion in 'Java' started by F, Mar 20, 2007.

  1. F

    F Guest

    Dear all,

    I am writing an application where I need to receive text in a
    different character set than the normal ascii.
    I am supposed to receive string in hebrew and make some computation on
    that based on the unicode values of each character.

    I was trying some basic code to see how it works but I can't get the
    output that I expect. For example:

    System.out.println("character value:"+ (int)args[0].charAt(0));

    The value in args[0] is a hebrew letter, which should have the Unicode
    value between 05D0 and 05FF. However, any value that I give as an
    input always returns 63 (the code for the '?').

    Can anyone help me?

    Kind regards,
    F.
    F, Mar 20, 2007
    #1
    1. Advertising

  2. F

    Oliver Wong Guest

    "F" <> wrote in message
    news:...
    > Dear all,
    >
    > I am writing an application where I need to receive text in a
    > different character set than the normal ascii.
    > I am supposed to receive string in hebrew and make some computation on
    > that based on the unicode values of each character.
    >
    > I was trying some basic code to see how it works but I can't get the
    > output that I expect. For example:
    >
    > System.out.println("character value:"+ (int)args[0].charAt(0));
    >
    > The value in args[0] is a hebrew letter, which should have the Unicode
    > value between 05D0 and 05FF. However, any value that I give as an
    > input always returns 63 (the code for the '?').
    >
    > Can anyone help me?


    Try output to a file instead of standard out. Your console may not be
    able to display certain characters, whereas you can always use a
    hex-editor to analyze the contents of a file.

    - Oliver
    Oliver Wong, Mar 20, 2007
    #2
    1. Advertising

  3. F wrote:
    > Dear all,
    >
    > I am writing an application where I need to receive text in a
    > different character set than the normal ascii.
    > I am supposed to receive string in hebrew and make some computation on
    > that based on the unicode values of each character.
    >
    > I was trying some basic code to see how it works but I can't get the
    > output that I expect. For example:
    >
    > System.out.println("character value:"+ (int)args[0].charAt(0));
    >
    > The value in args[0] is a hebrew letter, which should have the Unicode
    > value between 05D0 and 05FF. However, any value that I give as an
    > input always returns 63 (the code for the '?').
    >
    > Can anyone help me?
    >
    > Kind regards,
    > F.
    >


    What is happening is that the terminal is probably not recognizing the
    Hebrew letter when it is inputted. One way to test is to run from
    another Java class:

    Runtime.getRuntime().exec("java someClass \u05d0");

    If that works, it's your terminal that is having the problem.
    Joshua Cranmer, Mar 20, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Mark Bram
    Replies:
    0
    Views:
    3,899
    Robert Mark Bram
    Sep 28, 2003
  2. ygao

    unicode wrap unicode object?

    ygao, Apr 8, 2006, in forum: Python
    Replies:
    6
    Views:
    521
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 8, 2006
  3. Gabriele *darkbard* Farina

    Unicode digit to unicode string

    Gabriele *darkbard* Farina, May 16, 2006, in forum: Python
    Replies:
    2
    Views:
    486
    Gabriele *darkbard* Farina
    May 16, 2006
  4. gabor
    Replies:
    13
    Views:
    525
    Leo Kislov
    Nov 18, 2006
  5. Jean-Paul Calderone
    Replies:
    23
    Views:
    647
    Leo Kislov
    Nov 21, 2006
Loading...

Share This Page