working with ascii character set in oracle




I have an Oracle 9i Database that work with WE8MSWIN1252 charset.
lately I'd migrate from VB6 to .NET and I Understood that the CLR is working
in Unicode.

Now I've got a situation when I retriving data (in hebrew) of the database
and I'm getting Jibrish instead of hebrew!

I don't understand why the VB6 application can retrive the same information
from the database in the correct decoding while the .net CLR cannot do it

The only way I was able to decode it is with the following methods:

public static string encodingConvert
(string from_encoding, string to_encoding, string src)
Encoding fromEncoding = Encoding.GetEncoding(from_encoding);
Encoding toEncoding = Encoding.GetEncoding(to_encoding);
return toEncoding.GetString(fromEncoding.GetBytes(src));
public static string encodeheb(string src)
return encodingConvert("ISO-8859-8", "ISO-8859-1", src);
public static string decodeheb(string src)
return encodingConvert("ISO-8859-1", "ISO-8859-8", src);

But I wondering if there is a way the CLR can do it automaticliy.




Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question