3 Replies Latest reply on Apr 4, 2008 11:08 PM by 807601

    How do I read unicode text from a file into a string?

      I've just began learning all this stuff with I/OStreams and file readers / writers...
      Anyway, I have a text file encoded into unicode, which contains hebrew characters. What I want to do is read the characters into a String. The problem is, that let's say I have 3 characters in the file, I get 8 characters when I read it. And none of the 8 is any of the 3 original characters =///.
      I know that I can write unicode characters like this into a file (and make it be encoded into unicode):
      String str = "\u05D0\u05D1\u05D2";
      PrintWriter pw = new PrintWriter ("aaa.txt","unicode");
      Can I somehow read the text, and store it in a String, so it will be like this "\u05D0\u05D1\u05D2"? (So that I could compare between characters' unicode code point.

      Edited by: Hirsch on Apr 4, 2008 6:56 AM