-2

After I called the SAP RFC by JAVA, I get the returned data and print it in Eclipse. But Eclipse console shows the wrong encoded character which is not right (returned data language is Traditional Chinese).

enter image description here

My SAP codepage is 1100. And I've tried to set the different codepage including 8400, 8402, 8300, but still not work.

connectProperties.getProperty(DestinationDataProvider.JCO_CODEPAGE, "8400");        

How to solve this?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
LittleY
  • 17
  • 4

1 Answers1

0

Your question is not about JCo but about how to export character data from Java (always unicode) to some output stream (console) and how to display it.

A console output - maybe even without the capability to display the data with an appropriate font - is a useless test. At least check which default file.encoding is set in your Java system environment.

Instead of this, I'd recommend to write the Java character data explicitly to an UTF-8 encoded file and use an editor that is capable of handling and displaying unicode characters to show the file content. Or if you don't have a Unicode editor, then write a file with converting to the code page fitting to your character data, e.g. for SAP code page 8400, use the charset "GB2312" for your java.io.OutputStreamWriter.

Trixx
  • 1,796
  • 1
  • 15
  • 18