Strange Characters returning from long oracle queries.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For no apparent reason, simple select queries are returning what look to be
Chinese characters. At first, everything looks fine (correct & english),
until you get halfway through the result set. At that point, all results are
unreadable. This problem is consistent, but unpredictable. ie. same place in
each query, but not all queries.

I've trying using both OracleDataAdapter & OracleDataReader, both exhibit
the same results. No other platforms display this problem with the same
queries.

Anyone have any ideas?
 
It sounds like the string may be 1 byte off or was completely corrupted. If
you take the unexpected string result, convert it to a byte array and
convert it back to string offset by 1 byte, does it look more correct?
byte[] b = System.Encoding.Unicode.GetBytes(mystring);
string s = System.Encoding.Unicode.GetString(b, 1, b.Length-2);
 
No, none of the items were readable, although they all look like chinese now.


Mark Ashton said:
It sounds like the string may be 1 byte off or was completely corrupted. If
you take the unexpected string result, convert it to a byte array and
convert it back to string offset by 1 byte, does it look more correct?
byte[] b = System.Encoding.Unicode.GetBytes(mystring);
string s = System.Encoding.Unicode.GetString(b, 1, b.Length-2);

--
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

Mike said:
For no apparent reason, simple select queries are returning what look to
be
Chinese characters. At first, everything looks fine (correct & english),
until you get halfway through the result set. At that point, all results
are
unreadable. This problem is consistent, but unpredictable. ie. same place
in
each query, but not all queries.

I've trying using both OracleDataAdapter & OracleDataReader, both exhibit
the same results. No other platforms display this problem with the same
queries.

Anyone have any ideas?
 
Back
Top