Home All Groups Group Topic Archive Search About

working with ascii character set in oracle

Author
21 Feb 2006 2:51 PM
Dror
Hello,

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
automaticly.

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.

thanks,

Dror.

Author
22 Feb 2006 6:02 PM
Maya
You know why? cause you are an idiot.

Regards

AddThis Social Bookmark Button