Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ]
    Don't get me started about those stupid light bulbs.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!