WPF TextBox german text

Hi!

I read a isam file with german letter like "ä/ö/ü/ß"...

On debug time i can see the right letter...

if i make a move like this:

move ort to textBox1::Text

then there is a bug in the textBox1:Text it looks like then ASCII not ANSI!?

What is wrong?

 

 

  • Hallo Herr Riemke

    Try to call the following statement before reading the file:

    CALL  "PC_WIN_SET_CHARSET" USING BY VALUE 0.    

    *> This sets up so that all conversions are ANSI

    Freundliche Grüsse

    Werner Lanter

  • It's wrong!

    The file is ANSI!

    The Compiler Show me the right text

    But if i let run the the WPF side the text is wrong!!!

    It is not a part of converting!!!

    It is a bug in the Compiler!

    C# and VB is working with this data well!

  • It's wrong!

    The file is ANSI!

    The Compiler Show me the right text

    But if i let run the the WPF side the text is wrong!!!

    It is not a part of converting!!!

    It is a bug in the Compiler!

    C# and VB is working with this data well!

  • Verified Answer

    If the field that you are reading in is defined as PIC X then it will be read as ANSI data.

    The TextBox::Text property uses Unicode as do all .NET strings so the data needs to be converted before it is displayed.

    The following works for me where my-ansi-field would contain German characters read from a file:

      01 my-ansi-field pic x(5).

      01 myarray type Byte[].

           set myarray to my-ansi-field

           set self::textBox1::Text to type System.Text.Encoding::Default::GetString(myarray)

    -----------

    This may not be the best way to do this and I am open to suggestions from others but it appears to work correctly on my system.

    When you state that this works correctly in C#, how are you reading the data into the C# program if it resides in an ISAM file?          

    Thanks.