wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Reading a text file while controlling BIDI algorithm (visual BIDI)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Reading a text file while controlling BIDI algorithm (visual BIDI)?" Watch "Reading a text file while controlling BIDI algorithm (visual BIDI)?" New topic
Author

Reading a text file while controlling BIDI algorithm (visual BIDI)?

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,

I need to read some text files, containing Left-To-Right text(Hebrew and Arabic, yet the two languages never appear in the same file).

Unfortunately, the files were written by some ancient homemade DOS program, some 20 years ago.
It used the following algorithm:
  • Char encoding : IBM CP 824 (Arabic) , IBM CP 826 (Hebrew).
  • Ordering: 'Visual BIDI Ordering' , i.e. foreign words are reversed, while numbers/English remain intact (Note it's not a simple GUI issue - the data was physically stored in reverse order).


  • Now, I was hoping to find a proper encoding, in the lines of:


    Unfortunately, I can't find a java-supported encoding that supports *both* the char encoding and the ordering...
  • encode="IBM862" produces the correct letters, but in wrong order
  • encode="ISO-8859-8" produces gibberish letters, but in correct order

  • Does anyone please happen to know - is there a supported encoding for "IBM862 Visual" ?
    If not - is there at least some reliable java implementation for "BIDI with visual (reversed) ordering" ?

    Thanks !
    [ May 03, 2007: Message edited by: Sol Mam-Orn ]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Reading a text file while controlling BIDI algorithm (visual BIDI)?