java.text.Bidi functionality

Hi;

What .net class has the same functionality as java.text.Bidi (which I assume is not in J#)

All I need is the ability to give a method a string and find where the string changes direction.

thanks - dave


Answer this question

java.text.Bidi functionality

  • Dan Brusco

    Hi;

    It looks like this could do it. Does the following sound correct to you:
    1. call ScriptStringAnalyse() to get the SCRIPT_STRING_ANALYSIS data.
    2. call ScriptString XtoCP() character by character.
    3. if the character position is prev-1, this character is RTL.
    4. if the character position is prev+1, this character is LTR.
    5. if the character jumps to the left (more than prev-1), switch RTL/LTR.

    That still leaves the question of how do I know what the first character is

    To help you understand my question, I have xxx[data]yyy where I have to insert data in where the [data] is. So xxx and yyy can be Hebrew/Arabic or English or mixed. and the [data] can also be Hebrew/Arabic or English or mixed. For the out out I write it to a rtf or WordML file and those formats need to have markers when the direction changes. so if xxx is Hebrew and [data] is english and yyy is Hebrew, I need to end up with xxx<LTR>data<RTL>yyy.

    Is this correct

    thanks - dave


  • rsteckhan

    Maybe the following is what you want.

    http://www.unicode.org/reports/tr9/


    There are C++ and Java version. The Java version may work with J#.

  • floppes

    To get an authoritative response on this, I suggest you post this on the microsoft.public.dotnet.internationalization newsgroup. Internationalization folks from Microsoft on that newsgroup can help.

    Thanks - sushant

  • Nofi

    I guess you are talking about change in direction in languages that are bi-directional.
     
    Will try to hunt out something in .NET

    Thanks,
    Sushant


  • nancyboy

    Lets say I have some text, h is hebrew, e is english, and 1 is a number:

    hhh123hhh is a single run
    eee123eee is a single run
    hhheeehhh is three runs of hhh eee hhh

    What I need is a class I can call like new Bidi("hhheeehhh') and it then tells me I have 3 runs, where eahc is, and how long each is.

    - thanks - dave

  • BMoores

    Hi;

    What .net class has the same functionality as java.text.Bidi (which I assume is not in J#)

    All I need is the ability to give a method a string and find where the string changes direction.

    thanks - dave

  • ashish12345

    Uniscribe manages bidirectional character reordering using the Unicode bidirectional algorithm, and understands non-OpenType layout font formats for Arabic, Hebrew, and Thai shaping. < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

     Arabic, Hebrew, Farsi, Urdu and other bidirectional text requires reordering before display

     Uniscribe uses the paragraph as the unit for display. Note, this means that Uniscribe must be used for the entire paragraph, even if sections of the paragraph are not complex scripts.

     Uniscribe divides the paragraph into items -- strings that have the same script and direction.

    Uniscribe identifies the clusters in each run and determines the size of each cluster. A cluster is a script-defined, indivisible character grouping.Uniscribe sums the clusters to determine the size of a run

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/intl/uniscrib_4cj7.asp

     



  • java.text.Bidi functionality