views:

81

answers:

1

Hello, I have a Java project that connects to a C# program that prints Turkish words. Printing Turkish characters in C# using console is not causing any problems. However, the main issue is that when this C# program is called from Java, the Turkish characters are printed weirdly. What I would like to do is to get the output printed on console and reprint it using Java GUI without having any problems with Turkish characters. I really appreciate any kind of help. Many thanks in advance

A: 

The issue is likely to be that the C# application is encoding its character data in one encoding while the Java application is decoding the data as another. Assuming Windows, it is possibly an ANSI/OEM mismatch.

You need to identify the encoding the C# application is emitting. In the Java application, read each byte and check its hex value. Check to see if the bytes are Windows-1254, OEM-857 or whatever and then decode them appropriately using a reader with the appropriate encoding.

McDowell