My application reads data from database(oracle 10g)and it displays whatever it gets from database but there are some text which are written in hebrew and russian it is not displaying that text. Can anybody help
Thanks for quick reply.. See my application has three components UI which is written in C#,My business logics are written in java component and last is database which is oracle 10 g.Java component fetches data from database and sends to UI (C#)in xml format and Ui Displays that data. Whatever data i are getting in java component is corrupted as an example i am getting this hebrew text = ���������? and russian text = ��������� UI is displaying whatever it is getting from java component. I tried many things but thigs are not working as per expectation.
Do all components along the way use the same character encoding? Java uses Unicode internally, so if either C# or Oracle use something else, then the code needs to perform explicit conversions.
Paul's question is pertinent, though: How are you determining that the data is corrupt? If you're looking at a console (or a file in a non-Unicode-capable editor), then those may not be able to display the actual characters.
Also tell us what the things were that you tried, and how they didn't do what you thought they would. [ March 03, 2008: Message edited by: Ulf Dittmer ]
PS: You may need to explicitly define the C# Unicode input stream when reading java's output if C# isn't smart enough to know the difference between UTF-8/UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, etc...
PPS: BE == Big Endian == hex 10 equals 16 LE == Little Endian == hex 10 equals 1
Hi All, First of all let me clear your doubt when i am installing java component on linux machine its working fine but its not working Window xp(SP-2).Hebrew and russian languages and fonts are installed on my XP system. Even i tried "Daniel Chemko" code but its not working.
have a look on this java code this will help you understanding the problem
If it's neither a BOM nor an encoding problem, then you need to check at which point it gets corrupted. It is OK in the database? Is what the Java code gets from the DB still OK? Is what the Java code send to C# still OK? Is what C# gets from Java still OK? Breaking it down like this will give you a hint where to start looking for the problem.
And remember: displaying text in a console or a file may not work, so you need to think about how to ascertain whether the characters are OK or not.
i would like to add one more things I made one dummy application which can directally communicate with database then i am getting the proper data but once i am introducing this java component then i am getting this corrupted data.
OutputStream os = getResponseStream(); response = os.tostring()
This is incorrect. The toString method of a stream does not return the bytes that make up the stream and return them as a string (which should be apparent if you look at the length of what it returns, and compare that to what you are expecting). You need to write code that reads the bytes or characters, and then writes them to the response stream.
As I mentioned before, "os.toString()" does not return anything meaningful. You need to read the bytes from the streams. If you're unsure of how to do that, I'd suggest to read up on how streams work in Java. In particular, you need to be clear about the differences between byte streams and character streams, and the role encodings play to convert one to the other.
I have also faced the same problem. So while creating the Outputstream I have passed the Encoding format CP-1251 then it started working try to pass your encoding format. One more thing save your XMl file in Desktop and try to open it with uniread. If its looking corrupted then if your are using VM then save the Vm with your encoding format
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut: