IBM Informix Database Encoding Issue With .Net when Retrieve Arabic String RRS feed

  • General discussion

  • Dears , I have faced Issue When retrieve Data From IBM INFORMIX DATABASE

    -I have setup Version 2.90

    Data stored in DB like this 'نيمبالى بادرها سرادهى راجو'

    when i retrieve this from informix get in wrong format like this 'äíãÈÇáì ÈÇÏÑåÇ ÓÑÇÏåì ÑÇÌæ'

    database used this encoding 'en_us.819' So I have Tried A lot Of Solutions to fix this encoding i have create this method in .NET to Uni coding this wrong format to correct Arabic format

    private static string UniCode_IBM819(string str) { Encoding iso = Encoding.GetEncoding("iso-8859-1"); Encoding unicode = Encoding.GetEncoding(708);//Encoding.GetEncoding(864);//Encoding.UTF8; //byte[] unicodeBytes = unicode.GetBytes(str); byte[] isoBytes = iso.GetBytes(str); byte[] utfBytes = Encoding.Convert(iso,unicode, isoBytes); return unicode.GetString(utfBytes); }

     have tried encoding but get me result like "?????? ???? ????? ????? "

    what is encoding for this string 'äíãÈÇáì ÈÇÏÑåÇ ÓÑÇÏåì ÑÇÌæ'

    also database using en_US.819

    Please Help 

    • Moved by CoolDadTx Tuesday, December 1, 2015 2:35 PM ADO related
    Tuesday, December 1, 2015 1:48 PM

All replies

  • i'm not need to fix it from my database side i have very big and old database so fix from database side not acceptable ,, my issue is i need to encoding this string

    'äíãÈÇáì ÈÇÏÑåÇ ÓÑÇÏåì ÑÇÌæ' to be like this  'نيمبالى بادرها سرادهى راجو' 

    what is the encoding string that is change this 'نيمبالى بادرها سرادهى راجو'  string to this 'äíãÈÇáì ÈÇÏÑåÇ ÓÑÇÏåì ÑÇÌæ'

    Wednesday, December 2, 2015 4:57 AM

    i'm using this method

     private static string UniCodeIso819Towin1256(string src)
                Encoding iso819 = Encoding.GetEncoding("iso8859-1");
                Encoding win1256 = Encoding.GetEncoding(1256);
                byte[] isoBytes = iso819.GetBytes(src);
                return win1256.GetString(isoBytes);

    to Convert this Returned value 'äíãÈÇáì ÈÇÏÑåÇ ÓÑÇÏåì ÑÇÌæ' to The Original Format like this 'نيمبالى بادرها سرادهى راجو'

    Wednesday, December 2, 2015 7:49 AM